middleware('guest:club')->except('logout'); } /** * Get the guard to be used during authentication. * * @return \Illuminate\Contracts\Auth\StatefulGuard */ protected function guard(): StatefulGuard { return Auth::guard('club'); } /** * Show the application's login form. * * @return \Illuminate\Contracts\View\View */ public function showLoginForm(): View { return view('club.auth.login'); } /** * Where to redirect users after login. * * @return string */ protected function redirectTo(): string { return route('club.home.show'); } /** * Attempt to log the user into the application. * * @param \Illuminate\Http\Request $request * @return boolean */ protected function attemptLogin(Request $request) { $credentials = $this->credentials($request); $customer = Customer::query()->where('email', Arr::get($credentials, 'email'))->first(); if (!$customer) { return false; } // FIXME:DEVELOPMENT LOGIN ANYHOW, replace with CRM. $this->guard()->loginUsingId($customer->id); return true; } }