laravel-notify icon indicating copy to clipboard operation
laravel-notify copied to clipboard

How to show validation error?

Open BilawalSh opened this issue 2 years ago • 2 comments

I put validation in my controller but when any validation fails then it is not showing any message.

$request->validate([ 'name' => 'required', ]);

BilawalSh avatar Oct 30 '22 08:10 BilawalSh

Hi @BilawalSh how did you access the validation on the front-end

andrew21-mch avatar Oct 30 '22 14:10 andrew21-mch

This is the point that is unclear in the documentation.

I am doing this way

@if ($errors->any())
    @foreach ($errors->all() as $error)
        @php
            notify()->error($error);
        @endphp
    @endforeach
@endif

BilawalSh avatar Nov 07 '22 06:11 BilawalSh