-
Notifications
You must be signed in to change notification settings - Fork 1
Eager Loading
Gilberto Junior edited this page Dec 4, 2019
·
5 revisions
The same as found in the Laravel Documentations.
public function with(string $relation1, string $relation2, ...): self;
public function with(array|string $relations): self;
Simple relationship:
$repository->with('users');
Multiple relationships:
$repository->with('users', 'stores');
// or
$repository->with(['products', 'categories', 'brands']);
// or
$repository->with('users,companies,customers');
Nested relationships:
$repository->with('author.contacts');
by c0dehappy