If you just want a different connection for a specific model, set it's protected $connection variable in the model class to the name of the connection you want it to use.
By:Xtreem Solution
Thanks @xtreem But that is not what am looking for. I need to switch the database from within a given connection on the fly. Setting $connection in the model has been done, now the issue is changing the database in that connection for route model binding.
I hope it is clear.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community