jamesmills / eloquent-uuid

A Laravel Eloquent Model trait for adding and using a uuid with models
139 stars 14 forks source link

Adding Query Scopes #2

Closed jonspark closed 7 years ago

jonspark commented 7 years ago

This adds 2 local scopes to save having to add where('uuid', $uuid). The scopes are withUuid and withUuids.

For example, this would allow you to use: FooModel::withUuid($my_uuid)->find();.

Sorry, I think this includes the Laravel version update from the other PR. I can rollback if needs be.