N
N
Nurbolot Kairatbek uulu2021-06-11 13:23:05
Laravel
Nurbolot Kairatbek uulu, 2021-06-11 13:23:05

How to implement a one-to-many relationship in Laravel?

I have two tables: energy_network_regions and ts_staions
ts_stations has a ref_enr foreign key
in the energy_network_regions table with the ref_enr key there is only one element
in the ts_stations table with the ref_enr key there are many elements

how can I display elements from energy_network_regions by the ref_enr key like

this:

-Moscow network
-- Danilovskaya station
--Pushkinskaya station
--Teatralnaya station, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2021-06-11
@drone97

In Russian
In English

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question