W
W
WoodsWoods2021-11-21 15:52:51
Laravel
WoodsWoods, 2021-11-21 15:52:51

How to get result with OneToOne dynamic connection in Laravel?

I have 3 tables, all in different databases.

In db1 (the main site) there is a payments table with columns: id, player_id, connection_id
in the player_id column the id from db2 or db3 of the players table
is written in the connection_id column the name of the connection to the

db is written In db2 the players table with columns id, name ...
In d3 the same table as in db2

Is it possible to extract data from payments along with data from other tables, as usual with hasOne, only specifying the connection_id?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question