How to change the default DB connection for a specific controller?
Hello,
Is it possible to set/change the default DB connection on a specific controller to avoid writing DB::connection every time? This controller needs only this connection
You could use middleware for this, group all routes for the default DB connection in a middleware 'defaultDBConnection' or 'DBConnection1' for example and create a separate middleware for the routes that use the specific controller.
Then in those middleware's set the desired DB connection.