Support the ongoing development of →
Authentication Database Requests
Last updated 5 months ago.

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

Highly Skilled Laravel Developer

Dedicated PHP Developer


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.


@angujo did you able to find out the solution for this ?


Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

angujo angujo Joined 18 May 2017


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.