Did you specify connection
value from config/session.php file?
When using the "database" or "redis" session drivers, you may specify a connection that should be used to manage these sessions. This should correspond to a connection in your database configuration options.
This line:
'driver' => env('SESSION_DRIVER', 'database'),
only sets driver to database
if SESSION_DRIVER
environment variable is not defined... and it probably is, in your .env
file.
From config/session.php
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
Thanks, that solved the problem.
Another question. What is best practice working with .env vs config files? Should I have both and only store sensitive info in the .env?
In config files I store only static values that applies to all of my environments. In .env files only values that related to specific environment.
I don't say that this is the best practice, but this is the way I am doing it.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community