I have a problem with Session that won't persist.
In controller I have a function that loads a article for editing
public function getEdit($id)
{
try {
$news = News::findOrFail($id);
View::share('title', Lang::get('admin.editNews').": ".$news->title);
View::share('news', $news);
$this->layout->content = View::make('news.editNews');
} catch (Exception $e) {
Session::flash('message', Lang::get('admin.noSuchNews'));
Session::flash('notif', 'danger');
return Redirect::to("news");
}
}
And I have another function - index, that should display these flash messages.
public function getIndex()
{
var_dump(Session::get('message'));
}
Session is just not persisting. Not working with Session::flash
, not working with Session::put
.
Session::get('message')
is just always null
.
I guess I should mention that I did application routing like this:
Route::controller('news', 'NewsController');