Laravel 4 won't show default error messages -


I'm new to Laravel and I'm using it. It says that there are some default validation error messages, for example:

  • The user name field is required.
  • Email field is required.
  • The password field is required.

This message will not appear for some reasons, instead it is shown:

  • validation.email
  • validation.min .string
  • Verify Confirm

Why do not the default error message appear ?? (I know that I can do some custom)

This is my controller:

  public function sign_up () {// Get all requested data $ User = New user; $ Data = input :: all (); $ Validator = $ user- & gt; Hyacer Valid ($ data); If ($ valid-> pass ()) {$ user- & gt; Email = $ data ['email']; $ User- & gt; Password = $ data ['password']; $ User- & gt; Save (); Echo ('Data was saved.'); } Else {// Verification error message collect object. Redirect Return: From ('/ sign-up') - & gt; With input () - & gt; With partners ($ accredited); }}  

This method uses the method used by:

  The public function is User Valid ($ data) {// Verification Create obstacle sets. $ Rules = array ('email' = & gt; 'email | must | unique | unique: user', 'password' = & gt; 'required | minimum: 5 | confirmation'); // Create a new Verifier Example Refund $ Validator = Validator :: Creation ($ data, $ rule); }   

If your error messages contain validation .email, the key to verification localization, then Your lineup app has not loaded or does not have access to the localization folder.

Check that you have not removed app / lang / en and any file with validation.php with all default validation responses.

Alternatively you can do this, but using the localization file validation.php is a better way anyways, you want to go this way:

  $ messages = array ('required' = & gt; ': attribute field is required.',); $ Validator = verifier :: create ($ input, $ rules, $ message);  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -