title: Laravel 4 how to display flash message in view?
body: <p>I'm trying to get my flash message to display. </p>
  
  <p>This is in my routing file</p>
  
  <pre><code>Route::post('users/groups/save', function(){
  
  return Redirect::to('users/groups')-&gt;withInput()-&gt;with('success', 'Group Created Successfully.');
  
  });
  </code></pre>
  
  <p>This is in my view</p>
  
  <pre><code>{{ $success = Session::get('success') }}
  @if($success)
      &lt;div class="alert-box success"&gt;
          &lt;h2&gt;{{ $success }}&lt;/h2&gt;
      &lt;/div&gt;
  @endif
  </code></pre>
  
  <p>But nothing is working.</p>
  
  <p>When I try this, I get an error Variable $success is undefined. But it actually shows the flash message too.</p>
  
  <pre><code>{{ Session::get('success') }}
  @if($success)
      &lt;div class="alert-box success"&gt;
          &lt;h2&gt;{{ $success }}&lt;/h2&gt;
      &lt;/div&gt;
  @endif
  </code></pre>