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
|
|
|
|
8
|
|
|
class ForgotPasswordController extends Controller |
9
|
|
|
{ |
10
|
|
|
protected $data = []; // the information we send to the view |
11
|
|
|
|
12
|
|
|
/* |
13
|
|
|
|-------------------------------------------------------------------------- |
14
|
|
|
| Password Reset Controller |
15
|
|
|
|-------------------------------------------------------------------------- |
16
|
|
|
| |
17
|
|
|
| This controller is responsible for handling password reset emails and |
18
|
|
|
| includes a trait which assists in sending these notifications from |
19
|
|
|
| your application to your users. Feel free to explore this trait. |
20
|
|
|
| |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
use SendsPasswordResetEmails; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Create a new controller instance. |
27
|
|
|
* |
28
|
|
|
* @return void |
|
|
|
|
29
|
|
|
*/ |
30
|
|
|
public function __construct() |
31
|
|
|
{ |
32
|
|
|
if (config('backpack.base.separate_admin_session')) { |
33
|
|
|
$this->middleware('guest:'.config('backpack.base.admin_guard.name'), ['except' => 'logout']); |
34
|
|
|
} else { |
35
|
|
|
$this->middleware('guest'); |
36
|
|
|
} |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function guard() |
40
|
|
|
{ |
41
|
|
|
if (config('backpack.base.separate_admin_session')) { |
42
|
|
|
return \Auth::guard(config('backpack.base.admin_guard.name')); |
43
|
|
|
} else { |
44
|
|
|
return \Auth::guard(); |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
// ------------------------------------------------------- |
49
|
|
|
// Laravel overwrites for loading backpack views |
50
|
|
|
// ------------------------------------------------------- |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Display the form to request a password reset link. |
54
|
|
|
* |
55
|
|
|
* @return \Illuminate\Http\Response |
56
|
|
|
*/ |
57
|
|
|
public function showLinkRequestForm() |
58
|
|
|
{ |
59
|
|
|
$this->data['title'] = trans('backpack::base.reset_password'); // set the page title |
60
|
|
|
|
61
|
|
|
return view('backpack::auth.passwords.email', $this->data); |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
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.