mardi 12 juillet 2016

Laravel return view show message

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">&times;</a>
             
             
         </div>
  @endif

But it did not work, any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire