Skip to content

Commit 53a3309

Browse files
Improve doc
1 parent 154c408 commit 53a3309

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Readme.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,29 @@ class User extends Model
280280
}
281281
```
282282

283+
... Or with implementation of `Filterable` method:
284+
285+
286+
```php
287+
288+
use LaravelLegends\EloquentFilter\HasFilter;
289+
use LaravelLegends\EloquentFilter\Contracts\Filterable;
290+
291+
class User extends Model implements Filterable
292+
{
293+
use HasFilter;
294+
295+
public function getFilterable(): array
296+
{
297+
return [
298+
'name' => 'contains',
299+
'phone.number' => 'contains',
300+
'price' => ['max', 'min'],
301+
'profile_id' => '*',
302+
];
303+
}
304+
}
305+
```
283306

284307
### Using the allow method
285308

0 commit comments

Comments
 (0)