Download the PHP package otisz/laravel-eloquent-filter without Composer
On this page you can find all versions of the php package otisz/laravel-eloquent-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download otisz/laravel-eloquent-filter
More information about otisz/laravel-eloquent-filter
Files in otisz/laravel-eloquent-filter
Package laravel-eloquent-filter
Short Description Flexible Eloquent filter from URL queries
License MIT
Homepage https://github.com/Otisz/laravel-eloquent-filter
Informations about the package laravel-eloquent-filter
Laravel Eloquent Filter
Laravel package for generating flexible Eloquent filters.
Install
You can install the package via Composer
Usage
Use the artisan command to create a new filter class:
This command generates a new filter class to app/Filters
folder:
How to use in your controller:
There are 3 ways to boot up filter class:
Filter class contains 2 methods: search()
and order()
. \
You can pass \Illuminate\Http\Request
or \Illuminate\Foundation\Http\FormRequest
to these methods, but not required.
If you call a method that is not defined in the filter class, it will automatically call the Builder class.
For example filter class does not have toSql()
method:
TestFilter::boot(Model::class)->toSql();
In this case, toSql()
method called on Builder class: $this->builder->toSql()
Feel free write your method if needed.
Contributing
Security Vulnerabilities
If you discover any security-related issues, please email [email protected] instead of using the issue tracker. All security vulnerabilities will be promptly addressed.
Licence
The Laravel Eloquent Filter package is open-source software licensed under the MIT license.
All versions of laravel-eloquent-filter with dependencies
illuminate/database Version ^8.12|^9.0|^10.0|^11.0
illuminate/http Version ^8.12|^9.0|^10.0|^11.0
illuminate/support Version ^8.12|^9.0|^10.0|^11.0