What do you mean? Which config file? Where do you need to access the session, in the controller on on the view? Please elaborate more on your question.
Feb 23, 2018
6
Level 1
use session
how use session in config file?
Level 9
Level 1
i want use session in lfm.php .. it is for laravel file manager.. i want use session for change and save upload folder
Level 1
please help me
Level 9
You can read the docs here regarding sessions in Laravel. The easiest way to go about it is to use the helper function session(). You will be able to use these three methods
// To create a new session
session()->put('session-name', 'session-value');
// To check if a session exists
session()->has('session-name');
// To get an existing session
session()->get('session-name');
// To delete a session
session()->pull('session-name');
Level 1
nops - Class session does not exist
Level 42
I don't think the session is available when the config files are loaded. You can set the config values in the AppServiceProvider. At that point you'll have access to the session:
public function boot()
{
config(['lfm.whatever' => $something]);
}
Please or to participate in this conversation.