Hi to all, i'm new on the laravel world,
i have a db with users and params for connect to user's db, and a db for each user.
now when the user login i want to change the default db with the user's db.
i have tried to override the default connection with params like this:
Config::set("database.connections.mysql", [ "host" => "localhost", "driver" => "mysql", "default" => "mysql", "database" => $dati->db, "username" => "root", "password" => "" ]); DB::reconnect('mysql');
but it work only for the controller and model where i call the function.
there is a way to extends the new params to all model in the project?
thanks in advance.
I don't know. Maybe setting a middleware with that changes could help you out.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community