source: app/Http/Middleware/CheckVerifyNewEmail.php@ 19cbec3

develop
Last change on this file since 19cbec3 was 7304c7f, checked in by beratkjufliju <kufliju@…>, 3 years ago

added user authentication, create & forgot password methods and blades

  • Property mode set to 100644
File size: 579 bytes
RevLine 
[7304c7f]1<?php
2
3namespace App\Http\Middleware;
4
5use Closure;
6use App\Models\User;
7
8class CheckVerifyNewEmail
9{
10 /**
11 * Handle an incoming request.
12 *
13 * @param \Illuminate\Http\Request $request
14 * @param \Closure $next
15 * @return mixed
16 */
17 public function handle($request, Closure $next)
18 {
19 $id = $request->route("id");
20 $token = $request->route("token");
21
22 $user = User::findOrFail($id);
23
24 if($user->is_active) {
25 return redirect()->route("auth.loginShow");
26 }
27
28 return $next($request);
29 }
30}
Note: See TracBrowser for help on using the repository browser.