我想将我的中间件传递给控制器这是我的代码CheckSession Middlewarepublic function handle($request, Closure $next){ if (auth()->user()->isBasic()) { return redirect(route('home')); } return $next($request);}在我的Kenel.php中,我添加了这个protected $routeMiddleware = [ 'basic' => \App\Htpp\Middleware\CheckSession::class,];在我的控制器中public function __construct(){ $this->middleware('basic');}但它返回此错误App\Htpp\Middleware\CheckSession
1 回答
四季花海
TA贡献1811条经验 获得超5个赞
拼写错误错误,不要使用HttpHtpp
在你的kernel.php
protected $routeMiddleware = [
'basic' => \App\Http\Middleware\CheckSession::class,
];
- 1 回答
- 0 关注
- 79 浏览
添加回答
举报
0/150
提交
取消