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