Set the database for login time with config - laravel

I use the default laravel system authentication. I need to set the name of the database when the user logs:

config(['database.connections.mysql.database' => 'name_on_the_fly']); // example

But I do not know how, with event? with session?

What could be the right way? And how?

Thanks!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.