title: In Laravel, the best way to pass different types of flash messages in the session
body: <p>I'm making my first app in Laravel and am trying to get my head around the session flash messages. As far as I'm aware in my controller action I can set a flash message either by going</p>
  
  <pre><code>Redirect::to('users/login')-&gt;with('message', 'Thanks for registering!'); //is this actually OK?
  </code></pre>
  
  <p>For the case of redirecting to another route, or</p>
  
  <pre><code>Session::flash('message', 'This is a message!'); 
  </code></pre>
  
  <p>In my master blade template I'd then have:</p>
  
  <pre><code>@if(Session::has('message'))
  &lt;p class="alert alert-info"&gt;{{ Session::get('message') }}&lt;/p&gt;
  @endif
  </code></pre>
  
  <p>As you may have noticed I'm using Bootstrap 3 in my app and would like to make use of the different message classes: <code>alert-info</code>, <code>alert-warning</code>, <code>alert-danger</code> etc.</p>
  
  <p>Assuming that in my controller I know what type of message I'm setting, what's the best way to pass and display it in the view? Should I set a separate message in the session for each type (e.g. <code>Session::flash('message_danger', 'This is a nasty message! Something's wrong.');</code>)? Then I'd need a separate if statement for each message in my blade template.</p>
  
  <p>Any advice appreciated.</p>