1、创建中间件
php artisan make:middleware AdminCheck
2、注册中间件(Kernel.php)
protected $routeMiddleware = [ 'admincheck' => \App\Http\Middleware\AdminCheck::class, ];
3、使用中间件
Route::namespace('Admin')->name('admin')->middleware(['admincheck'])->group(function (){ });