Download the PHP package patienceman/filtan without Composer
On this page you can find all versions of the php package patienceman/filtan. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download patienceman/filtan
More information about patienceman/filtan
Files in patienceman/filtan
Package filtan
Short Description Filtan is a powerful Laravel QueryFilter package designed to simplify and enhance the process of filtering Eloquent queries. It enables developers to effortlessly apply filters to queries and customize the results based on dynamic parameters. By integrating Filtan into your Laravel project, you can build complex and flexible filtering mechanisms for your models effortlessly.
License MIT
Homepage https://github.com/patiencemanzen/Filtan
Informations about the package filtan
Simplifying Laravel Eloquent Query Filtering 🪴
Filtan is a Laravel QueryFilter package that simplifies and improves the process of filtering Eloquent queries. It allows developers to easily apply filters to queries and customize the results based on dynamic parameters. By integrating Filtan into your Laravel project, you can effortlessly create complex and flexible filtering mechanisms for your models.
Installation
To install the package, simply paste the command in the Laravel terminal.
Usage
We all love automated tasks like artisan commands. Filtan allows the creation of filter files with a single command, eliminating the need for manual creation.
Instead of creating files for traditional filters, I can do it for you with just one command. Let's use the Airplane Model example to create a new filter.
so it will create the filter file for u, Just in
It's possible to specify a custom path for your filter. Simply add it in front of the filter name. Let's revisit our example.
In your App/Services/Filters directory, Where are you gonna put all of your model filter files?
So now you have your filters function to be applied when a new AirplaneModel query is called!
We need to communicate to the model and tell them that we have filters so that we can call it anytime!!, So let's use a filterable trait to enable filter builder.
From now on, we will be able to call our filter anytime, any place that needs an Airplane model, so let's see how we can use this in our controller
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository and create a new branch for your contributions.
- Make your changes or additions, adhering to the coding guidelines.
- Submit a pull request detailing your changes, and our team will review it promptly.