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
|
|
|
* @return void |
|
|
|
|
33
|
|
|
*/ |
34
|
|
|
public function __construct() |
35
|
|
|
{ |
36
|
|
|
$this->middleware('guest'); |
37
|
|
|
} |
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
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
47
|
|
|
*/ |
48
|
|
|
public function showResetForm(Request $request, $token = null) |
49
|
|
|
{ |
50
|
|
|
return view('Auth.passwords.reset')->with( |
|
|
|
|
51
|
|
|
['token' => $token, 'email' => $request->email] |
52
|
|
|
); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Get the response for a successful password reset. |
57
|
|
|
* |
58
|
|
|
* @param string $response |
59
|
|
|
* @return \Illuminate\Http\RedirectResponse |
60
|
|
|
*/ |
61
|
|
|
protected function sendResetResponse($response) |
62
|
|
|
{ |
63
|
|
|
return redirect($this->redirectPath()) |
64
|
|
|
->with('success', trans($response)); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.