Home

Published

- 1 min read

if session has error in laravel

img of if session has error in laravel

The solution for this is noted below

if session has error in laravel

Solution

   @if (Session::has('success'))
<div class="alert alert-success">{{ Session::get('success') }}</div>
@endif
@if (Session::has('fail'))
<div class="alert alert-danger">{{ Session::get('fail') }}</div>
@endif

@if (session()->has('errors'))
<div class="alert alert-danger">
    <ul>
        @foreach ($errors->all() as $error)
        <li>{{ $error }}</li>
        @endforeach
    </ul>
</div>
<br />
@endif

Try other methods by searching on the site. That is if this doesn’t work