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

14 lines
247 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)
{
2019-03-31 11:00:07 +08:00
abort_unless(auth()->user()->isAdmin(), 403, trans('auth.check.admin'));
2019-04-19 19:36:36 +08:00
2016-08-28 10:05:21 +08:00
return $next($request);
}
}