Support the ongoing development of Laravel.io →
Authentication Database Requests
Last updated 2 years ago.
0

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

0

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.

0

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

0

Sign in to participate in this thread!

Eventy

Your banner here too?

angujo angujo Joined 18 May 2017

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.