Search code examples
laravellaravel-4laravel-validation

Do custom error messages in Laravel 4.2


I'm new in Larvel 4.2 here! How do I do a custom error messages in Laravel 4.2? And where do I put these codes? I've been using the defaults and I kind of wanted to use my own.


Solution

  • Did you try something? http://laravel.com/docs/4.2/validation#custom-error-messages

    Did you use Google? Check the documentation (official) it has everything. Be less lazy.

    $messages = array(
        'required' => 'The :attribute field is required.',
    );
    
    $validator = Validator::make($input, $rules, $messages);