ForgotPasswordController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Http\Controllers\Auth;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
  5. use Illuminate\Http\Request;
  6. class ForgotPasswordController extends Controller
  7. {
  8. /*
  9. |--------------------------------------------------------------------------
  10. | Password Reset Controller
  11. |--------------------------------------------------------------------------
  12. |
  13. | This controller is responsible for handling password reset emails and
  14. | includes a trait which assists in sending these notifications from
  15. | your application to your users. Feel free to explore this trait.
  16. |
  17. */
  18. use SendsPasswordResetEmails;
  19. /**
  20. * Create a new controller instance.
  21. *
  22. * @return void
  23. */
  24. public function __construct()
  25. {
  26. $this->middleware('guest');
  27. }
  28. protected function validateEmail(Request $request)
  29. {
  30. $this->validate($request, [
  31. 'email' => ['required', 'string', 'email', 'max:255'],
  32. ]);
  33. if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true') {
  34. $this->validate($request, [
  35. 'g-recaptcha-response' => 'required|recaptcha',
  36. ]);
  37. }
  38. }
  39. }