forked from Laravel-Backpack/Base
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForgotPasswordController.php
More file actions
62 lines (50 loc) · 1.74 KB
/
Copy pathForgotPasswordController.php
File metadata and controls
62 lines (50 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace Backpack\Base\app\Http\Controllers\Auth;
use Backpack\Base\app\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Support\Facades\Password;
class ForgotPasswordController extends Controller
{
protected $data = []; // the information we send to the view
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$guard = config('backpack.base.guard')
?: config('auth.defaults.guard');
$this->middleware("guest:$guard");
}
// -------------------------------------------------------
// Laravel overwrites for loading backpack views
// -------------------------------------------------------
/**
* Display the form to request a password reset link.
*
* @return \Illuminate\Http\Response
*/
public function showLinkRequestForm()
{
$this->data['title'] = trans('backpack::base.reset_password'); // set the page title
return view('backpack::auth.passwords.email', $this->data);
}
public function broker()
{
$passwords = config('backpack.base.passwords')
?: config('auth.defaults.passwords');
return Password::broker($passwords);
}
}