You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this point i have ["station","aircraft","aircraftConfig","person","owner"] in $values because aircraft starts with aircraftConfig the reject callback removes aircraft.
The expected output should be ["aircraft","aircraftConfig","owner","person","station"]
but it is ["aircraftConfig","owner","person","station"] with the result that every aircraft will be fetched with a singe select.
/** * Get the paths as a collection. * * Before returning the paths, we filter out any duplicates. For example, if the iterator * yields `user` and `user.country`, we only want `user.country` to be in the collection. * * @return Collection */publicfunctioncollect(): Collection
{
$values = collect($this);
return$values->unique()->reject(
fn ($path) => $values->contains(fn ($check) => $path !== $check && Str::startsWith($check, $path.'.'))
)->sort()->values();
}
At this point i have
["station","aircraft","aircraftConfig","person","owner"]
in$values
becauseaircraft
starts withaircraftConfig
the reject callback removesaircraft
.The expected output should be
["aircraft","aircraftConfig","owner","person","station"]
but it is
["aircraftConfig","owner","person","station"]
with the result that every aircraft will be fetched with a singe select.eloquent/src/QueryBuilder/EagerLoading/EagerLoadIterator.php
Line 76 in 98bbec0
The text was updated successfully, but these errors were encountered: