Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Błąd walidacji recaptchy w laravelu 4
Terrorizer
post 19.02.2016, 13:23:48
Post #1





Grupa: Zarejestrowani
Postów: 345
Pomógł: 3
Dołączył: 31.03.2012

Ostrzeżenie: (0%)
-----


Właśnie przyczepiam recaptche, która była już używana przez inne osoby wielokrotnie w projekcie i raczej powinna działać.
Próbuję wyciągnąć informację o błędzie w $validator-fails() z $validator->messages() i zawsze wywala mi taki błąd: "validation.recaptcha".
Co to może oznaczać?

  1. $rules = array();
  2.  
  3. $rules['g-recaptcha-response'] = 'required|recaptcha';
  4. $validator = Validator::make(Input::all(), $rules);
  5. $inputs = Input::all();
  6. if ( (!isset($inputs['g-recaptcha-response']) || !($inputs['g-recaptcha-response']))){
  7. return Redirect::to("/team")->with("error", 'Please prove you are not a robot.');
  8. }
  9. if($validator->fails()){
  10. $messages = $validator->messages();
  11.  
  12. return Redirect::to("/team")->with("error", 'You failed the captcha verification. Error message: '. $messages->first('g-recaptcha-response'));
  13. }


Ten post edytował Terrorizer 19.02.2016, 15:09:42
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 14:32