Skip to content

Commit c29d530

Browse files
committed
Update readme
1 parent 9e5c7d8 commit c29d530

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ Again, you may override the conventional local key by passing a second argument
451451

452452
return $this->embedsMany('Book', 'local_key');
453453

454+
Embedded relations will return a Collection of embedded items instead of a query builder. To simulate a more query-like behavior, embedded relations return a modified version of the Collection class with support for the following operations: `where($key, $operator, $value)` and `orderBy($key, $direction)`. This allows you to do query the collection results like this:
455+
456+
$books = $user->books()->where('rating', '>', 5)->orderBy('title')->get();
457+
454458
### EmbedsOne Relations
455459

456460
There is also an EmbedsOne relation, which works similar to the EmbedsMany relation, but only stores one embedded model.

0 commit comments

Comments
 (0)