Skip to content

Commit b6f187d

Browse files
committed
README updates
1 parent 82d720d commit b6f187d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,22 @@ $users = User::filter([
9494
```
9595

9696
* Without Filterable, filter() won’t exist on your model.
97-
* You can optionally define $allowedFilters in the model or rely on the config for auto-generated filters.
97+
* You can optionally define $allowedFilters in the model or rely on the config for auto-generated filters. If your $allowedFilters is protected, you have to define a public get method to access it. For example:
98+
99+
```php
100+
protected array $allowedFilters = ['status', 'name', 'role'];
101+
102+
public function getAllowedFilters(): array
103+
{
104+
return $this->allowedFilters;
105+
}
106+
```
107+
108+
If you know what you are doing, you can probably just leave $allowedFilters as public property
109+
110+
```php
111+
protected array $allowedFilters = ['status', 'name', 'role'];
112+
```
98113

99114
And also supports laravel paginate and simplePaginate
100115

0 commit comments

Comments
 (0)