Download the PHP package lacodix/laravel-model-filter without Composer
On this page you can find all versions of the php package lacodix/laravel-model-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-model-filter
laravel-model-filter
This package allows you to filter, search and sort models while fetching from database with ease. It contains additional functionality to use query strings to filter, search and sort.
With this package you can easily filter, search and sort your Eloquent models. It supports various filter types like strings, dates, numbers, and enums out of the box. You can also create complex custom filters to handle any specific database logic.
Additionally you can use the visualisation functionality of filters.
Documentation
You can find the entire documentation for this package on our documentation site
See our Upgrade Guide for information on how to upgrade from older versions.
Installation
Basic Usage
Filter
Create your first filter
Filters can be applied directly to models, but they can also be easily applied to relations and nested relations
using the RunsOnRelation trait. This automatically wraps the filter logic in a whereHas closure and correctly
qualifies the field names using the related table.
Search
Visualize
All filters have a blade template that can visualize the filter with one or multiple input fields. To visualize all filters of a dedicated model you can use a blade component:
Grouping
Sometimes you don't need all of the filters for all parts of a web application. Maybe there shall be different filters be available to the backend as in the frontend, or different user types shall be able to use different filters.
For such cases this package offers filter grouping when adding filters to models
The groups can be used in the scopes
or
Testing
Contributing
Please run the following commands and solve potential problems before committing and think about adding tests for new functionality.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-model-filter with dependencies
ext-intl Version *
illuminate/contracts Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.13.0