D
D
Donald_Duck2018-09-22 05:46:04
Laravel
Donald_Duck, 2018-09-22 05:46:04

Is it possible to simplify the interaction with the relationship chain?

Hello! Is it possible to simplify the selection from $user->region->timezoneto $user->timezonewith such a table structure?
timezones
- id
- name

regions
- id
- name
- timezone_id

users
- id
- name
- email
- region_id

I did not find such a link in the documentation or could not understand that this is what I need :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abordage, 2018-09-22
@abordage

Has Many Through
For deeper levels of nesting there is a package https://github.com/staudenmeir/eloquent-has-many-deep

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question