We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A list of available filters can be retrieved calling the following API:
GET -> /dashboard-api/:resource/filters
The response will include the filter-uri-key and a collection of fields
When sending the response back to the server to gather a filtered list of resource the user needs to follow the following steps:
Data structure:
{ "filter-uri-key": { "field-attribute": "value" } }
It needs to be base64 encode before sending to the server, so a typical workflow would be as the following:
const filters = { 'age-filter': { 'range': '20-30' } } const encodedFilter = btoa(JSON.stringify(filters)) GET -> /dashboard-api/:resource?filters=encodedFilter
On the backend, the filters are generally defined following this structure:
class KeywordFilter extends AbstractFilter { public function apply(Builder $builder, FieldsData $value): Builder { return $builder->where('keywords', 'LIKE', '%' . $value->get('keyword') . '%'); } public function fields(): array { return [ new EditableField('Keyword'), ]; } }
and applied to a resource by returning an array of filters:
class PageResource extends AbstractResource { public function filters(): array { return [ new KeywordFilter(), ]; } }
Todo:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For the frontend:
A list of available filters can be retrieved calling the following API:
GET -> /dashboard-api/:resource/filters
The response will include the filter-uri-key and a collection of fields
When sending the response back to the server to gather a filtered list of resource the user needs to follow the following steps:
Data structure:
It needs to be base64 encode before sending to the server, so a typical workflow would be as the following:
For the backend:
On the backend, the filters are generally defined following this structure:
and applied to a resource by returning an array of filters:
Todo:
The text was updated successfully, but these errors were encountered: