Skip to content

Commit 663b5b6

Browse files
Update filtering.md
1 parent 0560057 commit 663b5b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/features/filtering.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ public function scopeEvent(Builder $query, \App\Models\Event $event): Builder
148148
// GET /events?filter[event]=1 - the event with ID 1 will automatically be resolved and passed to the scoped filter
149149
```
150150

151+
If you use any other column aside `id` column for route model binding (ULID,UUID). Remeber to specify the value of the column used in route model binding
152+
153+
```php
154+
// GET /events?filter[event]=01j0rcpkx5517v0aqyez5vnwn - supposing we use a ULID column for route model binding.
155+
```
156+
151157
Scopes are usually not named with query filters in mind. Use [filter aliases](#filter-aliases) to alias them to something more appropriate:
152158

153159
```php

0 commit comments

Comments
 (0)