Create VerifyController
ADD
app/Http/Controllers/VerifyController.php
+<?php
+
+namespace App\Http\Controllers;
+
+use App\User;
+use Illuminate\Http\Request;
+
+class VerifyController extends Controller {
+ public function __invoke($token) {
+ $user = User::where('verification_token', $token)->first();
+
+ if (!$user) {
+ return redirect()->route('login');
+ }
+
+ $user->verification_token = null;
+ $user->save();
+
+ return redirect()->route('login');
+ }
+}

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

Create VerifyController