Skip to content

Commit

Permalink
Merge pull request #954 from justinkekeocha/patch-3
Browse files Browse the repository at this point in the history
Update filtering.md
  • Loading branch information
freekmurze authored Jul 3, 2024
2 parents 0560057 + 663b5b6 commit 45af547
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/features/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ public function scopeEvent(Builder $query, \App\Models\Event $event): Builder
// GET /events?filter[event]=1 - the event with ID 1 will automatically be resolved and passed to the scoped filter
```

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

```php
// GET /events?filter[event]=01j0rcpkx5517v0aqyez5vnwn - supposing we use a ULID column for route model binding.
```

Scopes are usually not named with query filters in mind. Use [filter aliases](#filter-aliases) to alias them to something more appropriate:

```php
Expand Down

0 comments on commit 45af547

Please sign in to comment.