1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Backpack\Base\app\Http\Controllers\Auth; |
4
|
|
|
|
5
|
|
|
use Backpack\Base\app\Http\Controllers\Controller; |
6
|
|
|
use Illuminate\Foundation\Auth\ResetsPasswords; |
7
|
|
|
use Illuminate\Http\Request; |
8
|
|
|
|
9
|
|
|
class ResetPasswordController extends Controller |
10
|
|
|
{ |
11
|
|
|
protected $data = []; // the information we send to the view |
12
|
|
|
|
13
|
|
|
/* |
14
|
|
|
|-------------------------------------------------------------------------- |
15
|
|
|
| Password Reset Controller |
16
|
|
|
|-------------------------------------------------------------------------- |
17
|
|
|
| |
18
|
|
|
| This controller is responsible for handling password reset requests |
19
|
|
|
| and uses a simple trait to include this behavior. You're free to |
20
|
|
|
| explore this trait and override any methods you wish to tweak. |
21
|
|
|
| |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
use ResetsPasswords; |
25
|
|
|
|
26
|
|
|
// where to redirect after password was reset |
27
|
|
|
protected $redirectTo = 'admin/dashboard'; |
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
|
|
|
// Laravel overwrites for loading backpack views |
41
|
|
|
// ------------------------------------------------------- |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Display the password reset view for the given token. |
45
|
|
|
* |
46
|
|
|
* If no token is present, display the link request form. |
47
|
|
|
* |
48
|
|
|
* @param \Illuminate\Http\Request $request |
49
|
|
|
* @param string|null $token |
50
|
|
|
* |
51
|
|
|
* @return \Illuminate\Http\Response |
52
|
|
|
*/ |
53
|
|
|
public function showResetForm(Request $request, $token = null) |
54
|
|
|
{ |
55
|
|
|
$this->data['title'] = trans('backpack::base.reset_password'); // set the page title |
56
|
|
|
|
57
|
|
|
return view('backpack::auth.passwords.reset', $this->data)->with( |
|
|
|
|
58
|
|
|
['token' => $token, 'email' => $request->email] |
59
|
|
|
); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
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.