Create controller for resetting passwords and ResetPassword mail
ADD
app/Http/Controllers/ResetPasswordController.php
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Mail\ResetPassword;
+use App\User;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Hash;
+use Illuminate\Support\Facades\Mail;
+
+class ResetPasswordController extends Controller {
+ public function get(Request $request) {
+ return view('reset_password', [
+ 'token' => $request->get('token')
+ ]);
+ }
+
+ public function post(Request $request) {
+ $request->validate([
+ 'email' => 'required_without:password|email',
+ 'password' => 'required_without:email|confirmed'
+ ]);
+
+ if ($email = $request->input('email') && !$request->has('token')) {
+ $existingUser = User::where('email', $email)->first();
+
+ if ($existingUser) {
+ $shippingToken = null;
+
+ $existingRecord = DB::selectOne('SELECT * FROM password_resets WHERE email = ?', [$email]);
+
+ if (!$existingRecord) {
+ $shippingToken = str_random(100);
+
+ DB::table('password_resets')->insert([
+ 'email' => $email,
+ 'token' => $shippingToken,
+ 'created_at' => date('Y-m-d H:i:s')
+ ]);
+ } else {
+ $shippingToken = $existingRecord->token;
+ }
+
+ Mail::to($email)->queue(new ResetPassword($shippingToken));
+ }
+
+ return redirect()
+ ->route('login')
+ ->with([
+ 'alert_type' => 'success',
+ 'alert_message' => 'If you registered with that address, we\'ve sent you an e-mail'
+ ]);
+ } else if ($request->has('token') && $request->has('password') && !$request->has('email')) {
+ $token = $request->input('token');
+ $password = $request->input('password');
+
+ $record = DB::selectOne('SELECT * FROM password_resets WHERE token = ?', [$token]);
+
+ if ($record) {
+ $user = User::where('email', $record->email)->first();
+
+ $user->password = Hash::make($password);
+ $user->save();
+ }
+
+ DB::table('password_resets')->where('token', $token)->delete();
+
+ return redirect()
+ ->route('login')
+ ->with([
+ 'alert_type' => 'success',
+ 'alert_message' => 'You\'ve successfully changed your password'
+ ]);
+ }
+
+ return redirect()->route('reset_password');
+ }
+}

ADD
app/Mail/ResetPassword.php
+<?php
+
+namespace App\Mail;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Mail\Mailable;
+use Illuminate\Queue\SerializesModels;
+use Illuminate\Contracts\Queue\ShouldQueue;
+
+class ResetPassword extends Mailable
+{
+ use Queueable, SerializesModels;
+
+ protected $token;
+
+ public function __construct($token) {
+ $this->token = $token;
+ }
+
+ public function build() {
+ return $this->view('emails.reset_password', [
+ 'token' => $this->token
+ ]);
+ }
+}

ADD
resources/views/emails/reset_password.blade.php
+@extends('emails.template')
+
+@section('content')
+ <a href="{{ config('app.url') }}/reset_password?token={{ $token }}">Click here to change your password</a>
+@endsection

MODIFY
resources/views/login.blade.php
resources/views/login.blade.php
<label>Password</label>
<input type="password" name="password" />
</div>
+ <div class="row row--separate" style="justify-content: space-between;">
+ <div class="row__column row__column--compact">
<button class="button">Log in</button>
+ </div>
+ <div class="row__column row__column--compact row__column--middle">
+ <a href="/reset_password">Forgot your password?</a>
+ </div>
+ </div>
</form>
</div>
<div class="box__section box__section--highlight text-center">

ADD
resources/views/reset_password.blade.php
+@extends('layout')
+
+@section('title', 'Reset Password')
+
+@section('body')
+ <div class="wrapper wrapper--narrow my-3">
+ <h2 class="text-center mb-3">Reset Password</h2>
+ <div class="box">
+ <div class="box__section">
+ <form method="POST">
+ {{ csrf_field() }}
+ @if ($token)
+ <input type="hidden" name="token" value="{{ $token }}" />
+ <div class="input">
+ <label>Password</label>
+ <input type="password" name="password" />
+ </div>
+ <div class="input">
+ <label>Verify Password</label>
+ <input type="password" name="password_confirmation" />
+ </div>
+ @else
+ <div class="input">
+ <label>E-mail</label>
+ <input type="email" name="email" />
+ </div>
+ @endif
+ <button class="button">Submit</button>
+ </form>
+ </div>
+ </div>
+ </div>
+@endsection
\ No newline at end of file

MODIFY
routes/web.php
routes/web.php
@@ -7,6 +7,9 @@ Route::post('/login', 'LoginController@store');
Route::get('/verify/{token}', 'VerifyController')->name('verify');
+Route::get('/reset_password', 'ResetPasswordController@get')->name('reset_password');
+Route::post('/reset_password', 'ResetPasswordController@post');
+
Route::get('/register', 'RegisterController@index')->name('register');
Route::post('/register', 'RegisterController@store');

Create controller for resetting passwords and ResetPassword mail