大家好:)我laravel 5文件routes.php文件,並返回該錯誤JWD過濾器不工作laravel 5
「在6243 BadMethodCallException compiled.php行: 方法過濾器不存在」
,但我曾正確laravel 4.2
我的代碼是:
Route::filter('authMobile', function($route, $request)
{
try{
$token = JWTAuth::getToken();
$user = JWTAuth::toUser($token);
$tokenStr = JWTAuth::getToken()->__toString();
if ($user->token != $tokenStr){
throw new Exception("Login Token don't match");
}
Session::put('user',$user->id);
}catch(Exception $e){
return Response::json(array(
'error' => true,
'message' => 'Invalid Session: '.$e->getMessage()
));
}
});
感謝,認爲
非常感謝你:)解決錯誤的問候 – Lucia