dimanche 26 avril 2020

Larave 5.2 Session not saving other data

I have a part of my code that saves data in the session and will retrieve my data on the same controller file but cannot access it. Here's how I do it:

public function index(Request $request)
{
    //some process
    \Session::put('data', [
            'recruits' => $recruits, 
            'header'             => $header,
            'condition'          => $condition,
            'sort'               => $sort,
        ]);
    //so when I retrieve it here thru dd(\Session::get('data')), it displays well.
    return redirect()->route('admin.filter');
}
//this is the function which is in the same file
public function filter()
{
    dd(\Session::get('data'));
   // data displayed in my session is only recruits and condition
}

Anyone has idea on this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire