artukrap
4 years ago
1041
2
Laravel

Laravel validation error messages

Posted 4 years ago by artukrap
@if (count($errors) > 0)
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif

I have standard validation from laravel, but for example I would like to add one more errors message to this $errors.

Is there possibility to do it from controller? Something like this?

$errors->add('Some dummy but needed error message');

Please sign in or create an account to participate in this conversation.