检查当前路由
public function handle($request, Closure $next)
{
if ($request->route()->named('index')) {
dd('123');
}
return $next($request);
}
出现错误:Call to a member function named() on null
不知道原因。是named方法不存在么?
存在的,你一步步输出下进行调试吧