Commit c29d5301 authored by Jens Segers's avatar Jens Segers

Update readme

parent 9e5c7d85
...@@ -451,6 +451,10 @@ Again, you may override the conventional local key by passing a second argument ...@@ -451,6 +451,10 @@ Again, you may override the conventional local key by passing a second argument
return $this->embedsMany('Book', 'local_key'); return $this->embedsMany('Book', 'local_key');
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:
$books = $user->books()->where('rating', '>', 5)->orderBy('title')->get();
### EmbedsOne Relations ### EmbedsOne Relations
There is also an EmbedsOne relation, which works similar to the EmbedsMany relation, but only stores one embedded model. There is also an EmbedsOne relation, which works similar to the EmbedsMany relation, but only stores one embedded model.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment