V
V
Vasyl Fomin2018-03-14 12:18:25
Laravel
Vasyl Fomin, 2018-03-14 12:18:25

Is it possible to join many models when querying with WITH in one query?

Hello. For example, there is an eloquent entity model on the site (entity), to which, when retrieved from the database, you need to attach many other models (users, bodies, teasers, ...):

  • entity
    • users
    • bodies
    • teasers


.... etc.
When using with - each join is a separate select statement. Is it possible to do this somehow without these selecto-in, like join-ohm, but the main thing is to get as a result an object (model) entity + relations with attached models, as when using with?
Relations here are polymorphic many-to-many.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andreo, 2018-03-14
@fomvasss

Of course not!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question