| 1 | <?php |
||
| 7 | class CheckIfAdmin |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Checked that the logged in user is an administrator. |
||
| 11 | * |
||
| 12 | * -------------- |
||
| 13 | * VERY IMPORTANT |
||
| 14 | * -------------- |
||
| 15 | * If you have both regular users and admins inside the same table, |
||
| 16 | * change the contents of this method to check that the logged in user |
||
| 17 | * is an admin, and not a regular user. |
||
| 18 | * |
||
| 19 | * @param [type] $user [description] |
||
|
|
|||
| 20 | * |
||
| 21 | * @return bool [description] |
||
| 22 | */ |
||
| 23 | private function checkIfUserIsAdmin($user) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Answer to unauthorized access request. |
||
| 31 | * |
||
| 32 | * @param [type] $request [description] |
||
| 33 | * |
||
| 34 | * @return [type] [description] |
||
| 35 | */ |
||
| 36 | private function respondToUnauthorizedRequest($request) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Handle an incoming request. |
||
| 47 | * |
||
| 48 | * @param \Illuminate\Http\Request $request |
||
| 49 | * @param \Closure $next |
||
| 50 | * |
||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | public function handle($request, Closure $next) |
||
| 65 | } |
||
| 66 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.