Download the PHP package samavidev/model-filtration without Composer
On this page you can find all versions of the php package samavidev/model-filtration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samavidev/model-filtration
More information about samavidev/model-filtration
Files in samavidev/model-filtration
Package model-filtration
Short Description Filtering the desired model records using query string
License MIT
Homepage https://github.com/SamaviDev/model-filtration
Informations about the package model-filtration
Filtering the desired model records using query string in Laravel app
This package provides an annotation to retrieve records of a specific model filtered using a query string. Here's a quick example:
Installation
You can install the package via composer:
Usage
- The first argument is valid fields that can be used in the query string. which can be in the form of a string or an array, you can also use an association array to assign a query to a specific model.
- The second argument is the operator that is applied to the table fields (
and,or,like,like:or). You can even usewithfor relationships. The default value isand.
for example:
It can also be used multiple times.
Filter group definition:
You can also define an Attribute class to use as a group of filters for your models. For this, you must implement the Group interface.
And finally, you can use it in your model like this:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Mahdi Samavi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.