blessing-skin-server/app/Http/Middleware/CheckAdministrator.php

16 lines
270 B
PHP
Raw Normal View History

2016-08-28 10:05:21 +08:00
<?php
namespace App\Http\Middleware;
2016-12-17 22:45:08 +08:00
class CheckAdministrator
2016-08-28 10:05:21 +08:00
{
public function handle($request, \Closure $next)
{
if (! auth()->user()->isAdmin()) {
2017-01-08 14:15:55 +08:00
abort(403, trans('auth.check.admin'));
2016-08-28 10:05:21 +08:00
}
return $next($request);
}
}