From 7c2d7f21d08c6574c306f6a15d95dc209e67cde8 Mon Sep 17 00:00:00 2001 From: frederikpyt Date: Tue, 30 Jun 2020 10:35:09 +0200 Subject: [PATCH] Fixes and implementation of forgot password --- skolehjem/app/Http/Controllers/UserController.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/skolehjem/app/Http/Controllers/UserController.php b/skolehjem/app/Http/Controllers/UserController.php index 105dcb9..3d5ad07 100644 --- a/skolehjem/app/Http/Controllers/UserController.php +++ b/skolehjem/app/Http/Controllers/UserController.php @@ -211,8 +211,17 @@ class UserController extends Controller return Response::detect('users.forgot'); } - public function forgot(){ + public function forgot(Request $request){ + $user = User::query()->where('email', '=', $request->email)->first(); + if($user == null){ + return redirect()->back(); + } + + //Send email + //TODO: Implement mail. + + return redirect()->route('users.login'); }