Currently when using with we will execute two queries the first one returning the initial model and the 2nd the initial model and its relations. Example:
Person::with('organization')->find(10) generates:
MATCH (person:Person) WHERE id(person) = 10 RETURN person
and
MATCH (person:Person), (person)-[:MEMBER_OF]->(organization:Organization) WHERE id(person) = 10 RETURN person, organization
There's no reason to execute both of these queries when we could settle for the latter.
Currently when using
with
we will execute two queries the first one returning the initial model and the 2nd the initial model and its relations. Example:Person::with('organization')->find(10)
generates:and
There's no reason to execute both of these queries when we could settle for the latter.