Set session variable in laravel
The correct syntax for this is: Session::set(‘variableName’, $value); For Laravel 5.4 and later, the correct method to use is put: Session::put(‘variableName’, $value); To get the variable, you would use: Session::get(‘variableName’); If you need to set it once, I’d figure out when exactly you want it set and use Events to do it. For example, if … Read more