私が確認したのはLaravel5.3ですが、下記の方法で可能だと思います。
App\Exceptionsの下に、Handler.phpがあります。
この中のunauthenticatedというメソッドのreturnでredirect先を制御してあげればOKだと思います。
php
1 3456
7 protected function unauthenticated($request, AuthenticationException $exception)
8 {
9 if ($request->expectsJson()) {
10 return response()->json(['error' => 'Unauthenticated.'], 401);
11 }
12 //↓↓ここを変更して下さい。
13 return redirect()->guest('/');
14 }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/01/27 06:20 編集
2017/01/27 06:41
2017/01/28 07:44 編集
2017/01/30 01:20