main
Last change
on this file was 5372778, checked in by bube-ristovska <ristovska725@…>, 3 months ago |
Middleware for permissions based on officer, policeman or both
|
-
Property mode
set to
100644
|
File size:
355 bytes
|
Rev | Line | |
---|
[5372778] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace App\Http\Middleware;
|
---|
| 4 |
|
---|
| 5 | use Closure;
|
---|
| 6 | use Illuminate\Http\Request;
|
---|
| 7 | use Illuminate\Support\Facades\Session;
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | class CheckPoliceman
|
---|
| 11 | {
|
---|
| 12 | public function handle(Request $request, Closure $next)
|
---|
| 13 | {
|
---|
| 14 | if (Session::get('is_policeman')) {
|
---|
| 15 | return $next($request);
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | return redirect()->route('unauth');
|
---|
| 19 | }
|
---|
| 20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.