Quantcast
Channel: Laravel 4 how to display flash message in view? - Stack Overflow
Viewing all articles
Browse latest Browse all 12

Laravel 4 how to display flash message in view?

$
0
0

I'm trying to get my flash message to display.

This is in my routing file

Route::post('users/groups/save', function(){

return Redirect::to('users/groups')->withInput()->with('success', 'Group Created Successfully.');

});

This is in my view

{{ $success = Session::get('success') }}
@if($success)
    <div class="alert-box success">
        <h2>{{ $success }}</h2>
    </div>
@endif

But nothing is working.

When I try this, I get an error Variable $success is undefined. But it actually shows the flash message too.

{{ Session::get('success') }}
@if($success)
    <div class="alert-box success">
        <h2>{{ $success }}</h2>
    </div>
@endif

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images