Answers for "laravel 8 error $message"

PHP
1

displaying errors in laravel

@if(count($errors) > 0)
<div class="p-1">
    @foreach($errors->all() as $error)
    <div class="alert alert-warning alert-danger fade show" role="alert">{{$error}} <button type="button" class="close"
            data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button></div>
    @endforeach
</div>
@endif
Posted by: Guest on January-19-2021
1

how to add an custom error to validater error in laravel

if (request('event') == null) {
    $validator->errors()->add('event', 'Please select an event');
}
Posted by: Guest on October-20-2020

Code answers related to "laravel 8 error $message"

Browse Popular Code Answers by Language