ResetPasswordController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Http\Controllers\AuthSupervisor;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Foundation\Auth\ResetsPasswords;
  5. use Illuminate\Support\Facades\Password;
  6. use Illuminate\Support\Facades\Auth;
  7. use Illuminate\Http\Request;
  8. class ResetPasswordController extends Controller
  9. {
  10. /*
  11. |--------------------------------------------------------------------------
  12. | Password Reset Controller
  13. |--------------------------------------------------------------------------
  14. |
  15. | This controller is responsible for handling password reset requests
  16. | and uses a simple trait to include this behavior. You're free to
  17. | explore this trait and override any methods you wish to tweak.
  18. |
  19. */
  20. use ResetsPasswords;
  21. /**
  22. * Where to redirect users after resetting their password.
  23. *
  24. * @var string
  25. */
  26. protected $redirectTo = '/supervisor/dashboard';
  27. public function __construct()
  28. {
  29. $this->middleware('teacher.guest');
  30. }
  31. public function showResetForm(Request $request, $token = null)
  32. {
  33. return view('auth_supervisor.passwords.reset_new')->with(
  34. ['token' => $token, 'email' => $request->email]
  35. );
  36. }
  37. public function broker()
  38. {
  39. return Password::broker('users');
  40. }
  41. /**
  42. * Get the guard to be used during password reset.
  43. *
  44. * @return \Illuminate\Contracts\Auth\StatefulGuard
  45. */
  46. protected function guard()
  47. {
  48. return Auth::guard('teacher');
  49. }
  50. }