laravelのバージョンが5.5からunauthenticatedメソッドの場所が変わったから。
https://teratail.com/questions/97310
私はhandler.phpに
handler.php
protected function unauthenticated($request, AuthenticationException $exception)
{
return $request->expectsJson()
? response()->json(['message' => 'Unauthenticated.'], 401)
: redirect()->guest(route('login'));
}
と書きました
以下参考↓
https://github.com/laravel/framework/commit/11b0de0485632d5712f7fb59071a4acbc4af2bdc