/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (Auth::customer()->check()) { return redirect()->intended('customer/dashboard'); } return $next($request); }
public function forgot_password(Form $form) { $request = $form->request->all(); if (!Auth::customer()->forgotPassword($request['email'])) { $error = trans('account.alerts.wrong_password_forgot'); Message::addError($error); throw new \Exception($error); } Message::addSuccess(trans('account.alerts.password_forgot')); }
public function forgot_password(Form $form) { $auth = Auth::customer(); $request = $form->request->all(); if ($auth->forgotPassword($request['email'])) { Message::addSuccess(trans('account.alerts.password_forgot')); } else { Message::addError(trans('account.alerts.wrong_password_forgot')); } }
protected function header() { $top_links = menu('header.links'); $top_links->add('cart', ['href' => url('cart'), 'text' => 'Cart #' . $this->cart->id . ' - ' . $this->cart->getSummary() . ' item(s)']); if (Auth::customer()->check()) { $top_links->add('account', ['href' => url('customer/dashboard'), 'text' => 'My Account']); $top_links->add('logout', ['href' => url('customer/logout'), 'text' => 'Logout']); } else { $top_links->add('login', ['href' => url('customer/login'), 'text' => 'Login/Register']); } }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (Auth::customer()->guest()) { if ($request->ajax()) { return response('Unauthorized.', 401); } else { return redirect()->guest('customer/login'); } } return $next($request); }
/** * Create a new authentication controller instance. */ public function __construct() { $this->auth = Auth::customer(); $this->middleware('guest', ['except' => 'getLogout']); $this->loadLayout(); }
/** * Create a new authentication controller instance. */ public function __construct() { $this->auth = Auth::customer(); $this->middleware('auth'); $this->loadLayout(); }