1 | <?php |
||
10 | class AuthController extends Controller |
||
11 | { |
||
12 | /** |
||
13 | * Get a JWT via given credentials. |
||
14 | * |
||
15 | * @param LoginRequest $request |
||
16 | * @return \Illuminate\Http\JsonResponse |
||
17 | */ |
||
18 | public function store(LoginRequest $request) |
||
28 | |||
29 | /** |
||
30 | * Log the user out (Invalidate the token). |
||
31 | * |
||
32 | * @return \Illuminate\Http\JsonResponse |
||
33 | */ |
||
34 | public function destroy() |
||
40 | |||
41 | /** |
||
42 | * Refresh a token. |
||
43 | * |
||
44 | * @return \Illuminate\Http\JsonResponse |
||
45 | */ |
||
46 | public function update() |
||
50 | |||
51 | /** |
||
52 | * Get the token array structure. |
||
53 | * |
||
54 | * @param string $token |
||
55 | * |
||
56 | * @return \Illuminate\Http\JsonResponse |
||
57 | */ |
||
58 | protected function respondWithToken($token) |
||
66 | |||
67 | /** |
||
68 | * Get the guard to be used for login, logout and token refreshes. |
||
69 | * |
||
70 | * @return \Illuminate\Contracts\Auth\StatefulGuard |
||
71 | */ |
||
72 | protected function guard() |
||
76 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: