Skip to content

Commit 9e6ae37

Browse files
authored
docs: include whereNotUuid in the documentation (#139)
1 parent 8cc59de commit 9e6ae37

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Post extends Model
5555
}
5656
```
5757

58-
You can have multiple UUID columns in each table by specifying an array in the `uuidColumns` method. When querying using the `whereUuid` scope, the default column - specified by `uuidColumn` will be used.
58+
You can have multiple UUID columns in each table by specifying an array in the `uuidColumns` method. When querying using the `whereUuid` or `whereNotUuid` scope, the default column - specified by `uuidColumn` will be used.
5959

6060
```php
6161
class Post extends Model
@@ -126,6 +126,20 @@ $post = Post::whereUuid($uuid, 'custom_column')->first();
126126

127127
// Find multiple posts with a custom column name
128128
$post = Post::whereUuid([$first, $second], 'custom_column')->get();
129+
130+
131+
132+
// Exclude a specific post using the default (uuid) column name
133+
$post = Post::whereNotUuid($uuid)->first();
134+
135+
// Exclude multiple posts using the default (uuid) column name
136+
$post = Post::whereNotUuid([$first, $second])->get();
137+
138+
// Exclude a specific post using a custom column name
139+
$post = Post::whereNotUuid($uuid, 'custom_column')->first();
140+
141+
// Exclude multiple posts using a custom column name
142+
$post = Post::whereNotUuid([$first, $second], 'custom_column')->get();
129143
```
130144

131145
If you use the suggested [laravel-efficient-uuid](https://github.com/michaeldyrynda/laravel-efficient-uuid) package, you will need to add a cast to your model in order to correctly set and retrieve your UUID values. This will ensure your UUIDs are written to your (MySQL) database as binary and presented as strings.

0 commit comments

Comments
 (0)