I
I
Ivan Vovchok2020-01-27 13:09:40
Laravel
Ivan Vovchok, 2020-01-27 13:09:40

How to dynamically change the value of the $connection property in a Laravel model?

The application works with two databases.
It is necessary, depending on the condition, to automatically change the value of the property $connectionin the models in order to determine which database to connect to at this particular moment

Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2020-01-27
@Vanovich

Feel free to study the code of the framework .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question