blessing-skin-server/app/Http/Middleware/CheckAdminMiddleware.php
2016-08-28 10:05:21 +08:00

18 lines
361 B
PHP

<?php
namespace App\Http\Middleware;
class CheckAdminMiddleware
{
public function handle($request, \Closure $next)
{
$user = (new CheckAuthenticated)->handle($request, $next, true);
if (!$user->is_admin) {
\Http::redirect('../user', '看起来你并不是管理员哦');
}
return $next($request);
}
}