catalyzecomm / laravel-filterable
A Simple filter library for laravel
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/catalyzecomm/laravel-filterable
Requires
- php: ^7.2
- illuminate/database: ^6.18.31|^7.22.4
- illuminate/http: ^6.18.31|^7.22.4
- illuminate/pipeline: ^5.5|^6.0|^7.0
- illuminate/support: ^6.0|^7.0
This package is not auto-updated.
Last update: 2025-10-31 10:57:31 UTC
README
This package allows you to easily handle database filtering through query strings.
Installation
You can install the package via composer:
for Laravel 6.x & 7.x
composer require catalyzecomm/laravel-filterable
Introduction
Introduction here
Usage
Define your model (use Catalyzecomm\Filterable Trait and define $allowedFilters)
use Catalyzecomm\Filterable; ... /** * Define an array of filter that allowed to use for this model * `key` as class name and `value` as field name(s) * * @var array */ protected static $allowedFilters = [ Catalyzecomm\Filters\Sort::class => 'created_at', Catalyzecomm\Filters\Keywords::class => 'name,email', ];
Use on your controller
$users = User::filterPaginate();
or
$users = User::filterAll();
Credits
License
The MIT License (MIT). Please see License File for more information.