]> BookStack Code Mirror - bookstack/blob - app/Http/Controllers/Auth/ResetPasswordController.php
Merge branch 'master' of github.com:BookStackApp/BookStack
[bookstack] / app / Http / Controllers / Auth / ResetPasswordController.php
1 <?php
2
3 namespace BookStack\Http\Controllers\Auth;
4
5 use BookStack\Http\Controllers\Controller;
6 use Illuminate\Foundation\Auth\ResetsPasswords;
7 use Illuminate\Http\Request;
8
9 class ResetPasswordController extends Controller
10 {
11     /*
12     |--------------------------------------------------------------------------
13     | Password Reset Controller
14     |--------------------------------------------------------------------------
15     |
16     | This controller is responsible for handling password reset requests
17     | and uses a simple trait to include this behavior. You're free to
18     | explore this trait and override any methods you wish to tweak.
19     |
20     */
21
22     use ResetsPasswords;
23
24     protected $redirectTo = '/';
25
26     /**
27      * Create a new controller instance.
28      *
29      * @return void
30      */
31     public function __construct()
32     {
33         $this->middleware('guest');
34         parent::__construct();
35     }
36
37     /**
38      * Get the response for a successful password reset.
39      *
40      * @param Request $request
41      * @param string $response
42      * @return \Illuminate\Http\Response
43      */
44     protected function sendResetResponse(Request $request, $response)
45     {
46         $message = trans('auth.reset_password_success');
47         session()->flash('success', $message);
48         return redirect($this->redirectPath())
49             ->with('status', trans($response));
50     }
51 }