added uuid query scope

This commit is contained in:
Jake Mitchell
2016-06-26 01:00:13 +00:00
parent ddea4dd573
commit 70cd832876
4 changed files with 45 additions and 0 deletions

View File

@@ -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