laravel get validator error message code example
Example 1: laravel print exception message
echo $e->getMessage();
Example 2: if any error in blade laravel
@if ($errors->any())
@foreach ($errors->all() as $error)
<div>{{$error}}</div>
@endforeach
@endif
Example 3: how to add an custom error to validater error in laravel
if (request('event') == null) {
$validator->errors()->add('event', 'Please select an event');
}