Download the PHP package aidynmakhataev/laravel-filterable without Composer
On this page you can find all versions of the php package aidynmakhataev/laravel-filterable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aidynmakhataev/laravel-filterable
More information about aidynmakhataev/laravel-filterable
Files in aidynmakhataev/laravel-filterable
Package laravel-filterable
Short Description :A laravel package to handle filtering by URL query strings
License MIT
Homepage https://github.com/aidynmakhataev/laravelfilterable
Informations about the package laravel-filterable
LaravelFilterable
A laravel package to handle filtering by URL query strings
Installation
Via Composer
Usage
- Create a new filter with the following artisan command:
This will create . You can override the default namespace in ****
Then, you need to define your filter logic by following this rules:
- Query string without a corresponding filter method are ignored
- Empty strings are ignored
- The value of the each request keys are injected into the corresponding filter method
- You are able to access the eloquent query builder instance by using
Example:
For defining methods for the following url request:
You would use the following methods:
-
Add the trait and bind created in step 1 Filter Class to your model.
- Finally, use it in your Controller:
Contributing
Anyone is welcome to contribute. Fork, make your changes, and then submit a pull request.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.