diff --git a/app/Http/Controllers/AuthenticateSessionController.php b/app/Http/Controllers/AuthenticateSessionController.php index 61cc4a9e..a4bf1da3 100644 --- a/app/Http/Controllers/AuthenticateSessionController.php +++ b/app/Http/Controllers/AuthenticateSessionController.php @@ -17,8 +17,9 @@ class AuthenticateSessionController extends Controller public function authenticate(AuthenticateSessionRequest $request): RedirectResponse { $credentials = $request->only("email", "password"); + $remember = $request->input("remember", false); - if (auth()->attempt($credentials)) { + if (auth()->attempt($credentials, $remember)) { $request->session()->regenerate(); return redirect()->route("home"); diff --git a/app/Http/Requests/Auth/AuthenticateSessionRequest.php b/app/Http/Requests/Auth/AuthenticateSessionRequest.php index af1ae8ee..53e248c3 100644 --- a/app/Http/Requests/Auth/AuthenticateSessionRequest.php +++ b/app/Http/Requests/Auth/AuthenticateSessionRequest.php @@ -18,6 +18,7 @@ public function rules(): array return [ "email" => ["required", "email", "max:255"], "password" => ["required", "string", "min:8", "max:255"], + "remember" => ["nullable", "boolean"], ]; } } diff --git a/resources/js/components/Common/Checkbox.vue b/resources/js/components/Common/Checkbox.vue index 5f808788..78f49ffe 100644 --- a/resources/js/components/Common/Checkbox.vue +++ b/resources/js/components/Common/Checkbox.vue @@ -1,11 +1,15 @@ + +