[WIP] Order process
This commit is contained in:
40
app/Http/Controllers/Shop/Auth/ConfirmPasswordController.php
Normal file
40
app/Http/Controllers/Shop/Auth/ConfirmPasswordController.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
||||
@@ -3,22 +3,27 @@
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Get password request form view.
|
||||
*
|
||||
* @return Application|Factory|View
|
||||
*/
|
||||
protected function guard()
|
||||
{
|
||||
return Auth::guard('customer');
|
||||
}
|
||||
|
||||
public function broker()
|
||||
{
|
||||
return Password::broker('customers');
|
||||
}
|
||||
|
||||
public function showLinkRequestForm()
|
||||
{
|
||||
return view('boilerplate::auth.passwords.email');
|
||||
return view('Shop.auth.passwords.email');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ class LoginController extends Controller
|
||||
|
||||
public function showLoginForm()
|
||||
{
|
||||
$data['url'] = route('Shop.login.post');
|
||||
return view('Shop.auth.login', $data);
|
||||
return view('Shop.auth.login');
|
||||
}
|
||||
|
||||
public function login(Request $request)
|
||||
@@ -36,7 +35,7 @@ class LoginController extends Controller
|
||||
'password' => 'required|min:8',
|
||||
]);
|
||||
|
||||
if (Auth::guard('customer')->attempt($credentials, $request->get('remember'))) {
|
||||
if ($this->guard()->attempt($credentials, $request->get('remember'))) {
|
||||
$request->session()->regenerate();
|
||||
return redirect()->intended(route('home'));
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use App\Rules\Password as PasswordRules;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
@@ -19,8 +22,29 @@ class ResetPasswordController extends Controller
|
||||
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
$data['token'] = $token;
|
||||
$data['email'] = $request->email;
|
||||
return view('Auth.passwords.reset', $data);
|
||||
$token = $request->route()->parameter('token');
|
||||
|
||||
return view('Shop.auth.passwords.reset')->with(
|
||||
['token' => $token, 'email' => $request->email]
|
||||
);
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => ['required', 'confirmed', new PasswordRules()],
|
||||
];
|
||||
}
|
||||
|
||||
public function broker()
|
||||
{
|
||||
return Password::broker('customers');
|
||||
}
|
||||
|
||||
protected function guard()
|
||||
{
|
||||
return Auth::guard('customer');
|
||||
}
|
||||
}
|
||||
|
||||
41
app/Http/Controllers/Shop/Auth/VerificationController.php
Normal file
41
app/Http/Controllers/Shop/Auth/VerificationController.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user