Skip to content

Commit a9a4141

Browse files
committed
Add docs about uuid scope
1 parent 32082b8 commit a9a4141

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

uuid.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The uuid trait automatically generates uuids for your Eloquent models.
99
- [Usage](#usage)
1010
- [Primary Key](#primary-key)
1111
- [Custom Column](#custom-column)
12+
- [Scope](#scope)
1213

1314
## Usage
1415

@@ -60,4 +61,15 @@ class User extends Model
6061

6162
const UUID_COLUMN = 'id';
6263
}
63-
```
64+
```
65+
66+
## Scope
67+
68+
The trait provides a convenient scope for finding models based on the uuid column.
69+
`Model::uuid('638fa033-2bcf-48dd-896e-6e2b138f7138')->first()`, or you may also supply an array of uuids
70+
`Model::uuid([
71+
'5d95a9c2-bc2c-4a2a-8e97-1eabf472319e',
72+
'5785e0eb-155f-4c25-9e1a-c123a29a0cd8',
73+
'041f681f-9c9b-4ca4-b623-fb9928490e8c',
74+
'93b1e345-b262-4bc7-ad41-034f755a00c3',
75+
])->get()`

0 commit comments

Comments
 (0)