vendredi 8 septembre 2017

Laravel controller session store/retrieve troubles

I'm having troubles storing/retrieving data from session. My session variable from_date is not changing. At beginning, I'm checking if session has no value.

    if (!($request->session()->has('from_date')))
    {
        $from= date('Y-m-d', mktime(0, 0, 0, date("m") - 1, "01", date("Y")));
        session(['from_date' => $from]);            
    }
    else
    {
       $from=$request->session()->get('from_date');              
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire