I am wanting the lifetime minutes to be set within an admin settings and so I would like this value to be retrieved from a database rather than currently set within session.php
Is this possible to override anywhere or to at least point lifetime to a DB select?
You can store the value of the life time in a table and retrieve it using helpers in the config file:
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => get_life_time_form_db(),
The same way session driver is set form the .env file:
I get Fatal error: Call to a member function connection() on null in /home/dev1/sites/xxx/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php
Sorry @rickbolton , seems like this is not going to work, take a look at this stackoverflow issue, I guess we have to figure a way to query our setting without using Eloquent
Where is session.php config returned to? I saw this stackoverflow post and it does seem like we are trying to use DB or eloquent before it's initialized