Session doesnt have value on laravel 4

444 views Asked by At

I was wondering why is it that my when I

Session::flash('status', 'success');

and when I try to echo its value like

$status = Session::get('status');
dd($status);

Im getting a NULL value.

my controller:

Session::flash('status','success');
Session::flash('message', Lang::get('alerts.messages.successUpdate'));
Session::flash('type', Lang::get('alerts.transactions.po'));

return Redirect::action('SuppliersController@show',$supplierId);

my macro:

<?php
HTML::macro('flash', function()
{
$message    = Session::get('message');
$status     = Session::get('status');
$type       = Session::get('type');
return ($message) ? '<div class="alert alert-'.$status.'"><a class="close" data-dismiss="alert" href="#" aria-hidden="true">&times;</a><p>'.$message.' '.$type.'</p></div>':''; });
  ?>

my view:

<?php echo HTML::flash(); ?>

All variables contains the correct value except for the $status which is NULL

Is there anything I am missing on my code? Or do I always need to get the flash value from the lang folder? And cant I just declare its value on the second parameter?

0

There are 0 answers