Answers for "laravel with error message"

PHP
7

laravel success message

return redirect()->back()->with('message', 'IT WORKS!');

Displaying message if it exists:

@if(session()->has('message'))
    <div class="alert alert-success">
        {{ session()->get('message') }}
    </div>
@endif
Posted by: Guest on March-22-2020
1

validation error message in laravel

@if ($errors->any())
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
Posted by: Guest on August-04-2021

Code answers related to "laravel with error message"

Browse Popular Code Answers by Language