Reputation: 58652
I'm trying to print out my session/flash message to my user(s) as feedback.
I couldn't get it to display, worse than that, it give me the error.
{{-- Flash Message --}}
@if($success_register)
@if ($message = Session::get('success_register'))
<div class="alert alert-block alert-success">
<i class=" fa fa-check cool-green "></i>
{{ nl2br($message) }}
</div>
@endif
@endif
return Redirect::to('/')
->with('success_register',' Your Account has been created ! <small> Email has been sent to set-password, and activation.</small>');
Upvotes: 0
Views: 2567
Reputation: 12244
You should use Session::get('success_register') on both occassions simply said!
@if(Session::has('success_register'))
<div class="alert alert-block alert-success">
<i class=" fa fa-check cool-green "></i>
{{ nl2br(Session::get('success_register')) }}
</div>
@endif
Upvotes: 3