develop
Last change
on this file since 9d1628a 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:
575 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Http\Middleware;
|
---|
4 |
|
---|
5 | use Closure;
|
---|
6 |
|
---|
7 | class CheckIsActive
|
---|
8 | {
|
---|
9 | /**
|
---|
10 | * Handle an incoming request.
|
---|
11 | *
|
---|
12 | * @param \Illuminate\Http\Request $request
|
---|
13 | * @param \Closure $next
|
---|
14 | * @return mixed
|
---|
15 | */
|
---|
16 | public function handle($request, Closure $next)
|
---|
17 | {
|
---|
18 | if(!auth()->user()->is_active) {
|
---|
19 |
|
---|
20 | $user = auth()->user();
|
---|
21 | $user->is_online = false;
|
---|
22 | $user->save();
|
---|
23 |
|
---|
24 | auth()->logout();
|
---|
25 |
|
---|
26 | return redirect()->route("auth.loginShow");
|
---|
27 | }
|
---|
28 |
|
---|
29 | return $next($request);
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.