Answer the question
In order to leave comments, you need to log in
Why are Laravel sessions not working?
controller
if ($company == null) {
return redirect()->back()->with('error', ['Внимание! ...']);
}
@if(session()->has('error'))
<div class="alert alert-danger alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">x</a>
{{ session()->get('error') }}
</div>
@endif
Answer the question
In order to leave comments, you need to log in
// First option
{{-- Вывод списка ошибок --}}
@if(!is_null($errors->all()))
@foreach($errors->all() as $error)
<div class="row justify-content-center">
<div class="col-md-11">
<div class="alert alert-danger alert-dismissible fade show" role="alert">
{{ $error }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
@endforeach
@endif
{{-- Вывод списка ошибок--}}
@if(!is_null(session('errors')))
@foreach(session('errors') as $error)
<div class="row justify-content-center">
<div class="col-md-11">
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ $error}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
@endforeach
@endif
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question