回答編集履歴
2
redirectToByGuardsの記述例
test
CHANGED
@@ -84,9 +84,21 @@
|
|
84
84
|
|
85
85
|
|
86
86
|
|
87
|
-
protected function redirectToByGuard($request, $guards) {
|
87
|
+
protected function redirectToByGuards($request, $guards) {
|
88
88
|
|
89
|
+
if (!$request->expectsJson()) {
|
90
|
+
|
91
|
+
if ($guards[0] === 'admin') {
|
92
|
+
|
93
|
+
return route($this->admin_route);
|
94
|
+
|
95
|
+
} else {
|
96
|
+
|
89
|
-
|
97
|
+
return route($this->user_route);
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
}
|
90
102
|
|
91
103
|
}
|
92
104
|
|
1
パラメタ名が合ってなかったので修正
test
CHANGED
@@ -84,9 +84,9 @@
|
|
84
84
|
|
85
85
|
|
86
86
|
|
87
|
-
protected function redirectToByGuard($request, $guard) {
|
87
|
+
protected function redirectToByGuard($request, $guards) {
|
88
88
|
|
89
|
-
// $guardを利用して行き先を振り分ける
|
89
|
+
// $guardsを利用して行き先を振り分ける
|
90
90
|
|
91
91
|
}
|
92
92
|
|