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 { die((new MailMessage()) ->template('notifications::email-club') ->subject(trans("Mise à jour de l'email - :site_name", [ 'site_name' => config('app.name') ])) ->greeting(trans('Bonjour :name', ['name' => 'sdsd'])) ->action('bonton action', route('fo.add-single-optin')) ->line(trans("L'email associé à votre compte :site_name vient d'être modifié.", [ 'site_name' => config('app.name') ]))->render()); return view('club.auth.login'); } /** * Where to redirect users after login. * * @return string */ protected function redirectTo(): string { return $this->authLoggedRedirectPath(); } /** * 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; } }