1 | <?php |
||
10 | class ResetPasswordController extends Controller |
||
11 | { |
||
12 | /* |
||
13 | |-------------------------------------------------------------------------- |
||
14 | | Password Reset Controller |
||
15 | |-------------------------------------------------------------------------- |
||
16 | | |
||
17 | | This controller is responsible for handling password reset requests |
||
18 | | and uses a simple trait to include this behavior. You're free to |
||
19 | | explore this trait and override any methods you wish to tweak. |
||
20 | | |
||
21 | */ |
||
22 | use ResetsPasswords; |
||
23 | |||
24 | /** |
||
25 | * Where to redirect users after resetting their password. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $redirectTo = '/'; |
||
30 | |||
31 | /** |
||
32 | * Create a new controller instance. |
||
33 | */ |
||
34 | public function __construct() |
||
38 | |||
39 | /** |
||
40 | * Display the password reset view for the given token. |
||
41 | * |
||
42 | * If no token is present, display the link request form. |
||
43 | * |
||
44 | * @param \Illuminate\Http\Request $request |
||
45 | * @param string|null $token |
||
46 | * |
||
47 | * @return \Illuminate\View\View |
||
48 | */ |
||
49 | public function showResetForm(Request $request, $token = null): View |
||
55 | |||
56 | /** |
||
57 | * Get the response for a successful password reset. |
||
58 | * |
||
59 | * @param string $response |
||
60 | * |
||
61 | * @return \Illuminate\Http\RedirectResponse |
||
62 | */ |
||
63 | protected function sendResetResponse($response): RedirectResponse |
||
68 | } |
||
69 |
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: