|
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\SendsPasswordResetEmails; |
|
7
|
|
|
use Illuminate\Support\Facades\Password; |
|
8
|
|
|
|
|
9
|
|
|
class ForgotPasswordController 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 emails and |
|
19
|
|
|
| includes a trait which assists in sending these notifications from |
|
20
|
|
|
| your application to your users. Feel free to explore this trait. |
|
21
|
|
|
| |
|
22
|
|
|
*/ |
|
23
|
|
|
|
|
24
|
|
|
use SendsPasswordResetEmails; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Create a new controller instance. |
|
28
|
|
|
* |
|
29
|
|
|
* @return void |
|
|
|
|
|
|
30
|
|
|
*/ |
|
31
|
|
|
public function __construct() |
|
32
|
|
|
{ |
|
33
|
|
|
$guard = backpack_guard_name(); |
|
34
|
|
|
|
|
35
|
|
|
$this->middleware("guest:$guard"); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
// ------------------------------------------------------- |
|
39
|
|
|
// Laravel overwrites for loading backpack views |
|
40
|
|
|
// ------------------------------------------------------- |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Display the form to request a password reset link. |
|
44
|
|
|
* |
|
45
|
|
|
* @return \Illuminate\Http\Response |
|
46
|
|
|
*/ |
|
47
|
|
|
public function showLinkRequestForm() |
|
48
|
|
|
{ |
|
49
|
|
|
$this->data['title'] = trans('backpack::base.reset_password'); // set the page title |
|
50
|
|
|
|
|
51
|
|
|
return view('backpack::auth.passwords.email', $this->data); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Get the broker to be used during password reset. |
|
56
|
|
|
* |
|
57
|
|
|
* @return \Illuminate\Contracts\Auth\PasswordBroker |
|
58
|
|
|
*/ |
|
59
|
|
|
public function broker() |
|
60
|
|
|
{ |
|
61
|
|
|
$passwords = config('backpack.base.passwords', config('auth.defaults.passwords')); |
|
62
|
|
|
|
|
63
|
|
|
return Password::broker($passwords); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
Adding a
@returnannotation 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.