How can I show a message after I return a view in my Controller.
I am using Laravel 5.1.
return view('pr.new', [
'errorMessageDuration' => 'error too long',
'route' => 'createPr',
'type' => 'new',
]);
I tried to call the message like this:
@if(session('errorMessageDuration'))
<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
{{ session('errorMessageDuration') }}
{{ Input::get('title') }}
</div>
@endif
But it did not work, any ideas?
Use code Like This
@if(isset($errorMessageDuration))
<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
{{ $errorMessageDuration }}
{{ Input::get('title') }}
</div>
@endif