added uuid query scope
This commit is contained in:
14
README.md
14
README.md
@@ -102,6 +102,20 @@ And to retrieve meta information, use the 'read' method.
|
||||
$post->read('author'); //returns 'Bob Saget'
|
||||
```
|
||||
|
||||
### Query Builder
|
||||
|
||||
Let's say you need to retrieve the post that has a certain UUID (maybe you gave it out in a url or something)
|
||||
|
||||
It's super easy to search for it:
|
||||
``` php
|
||||
Post::withUuid($uuid)->first();
|
||||
```
|
||||
|
||||
It is completely integrated into the query builder, so you can still do stuff like:
|
||||
``` php
|
||||
Post::withUuid($uuid)->pluck('username');
|
||||
Post::withUuid($uuid)->firstOrFail();
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
Reference in New Issue
Block a user