Download the PHP package oooiik/laravel-query-filter without Composer

On this page you can find all versions of the php package oooiik/laravel-query-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-query-filter

Laravel Query Filter

Latest Version on Packagist Total Downloads PHP Version

A clean, convention-based way to extract Eloquent query filters into dedicated filter classes. Keep your controllers thin, your scopes focused, and your filtering logic testable.

Features

Installation

The service provider is auto-registered via Laravel's package discovery.

Quick Start

1. Generate a filter

This creates app/Filters/UserFilter.php.

2. Define your filter methods

Each public method becomes a filter key matching its name:

3. Attach the filter to your model

4. Use it

Missing keys are silently ignored — only the filter methods that match input parameters run.

Advanced Usage

Default parameters

Use the $default property to pre-fill values when a key is missing from the input:

Calling User::filter([]) will still apply status = active and sort by created_at desc.

Fallback methods

Use $fallback to redirect missing input keys to a different method:

If the search key is missing from input, searchByName runs with whatever value was provided as the fallback source.

Standalone filter instance (chaining)

Apply multiple parameter sets to the same filter:

Accessing all parameters

Filter methods receive the full parameter array as a second argument:

Comparison with spatie/laravel-query-builder

laravel-query-filter spatie/laravel-query-builder
Approach Convention-based — method = filter key Declarative — register allowed filters explicitly
Per-model class Yes, dedicated filter class Optional, often inline
Custom filter logic Plain PHP method AllowedFilter::callback()
Best for Complex filtering with reusable logic API endpoints with simple filtering needs

Both are great — choose laravel-query-filter when you want a dedicated class per model with reusable, testable filter logic.

Requirements

Compatibility Matrix

Laravel PHP Status
12.x 8.2+ ✅ Supported
11.x 8.2+ ✅ Supported
10.x 8.1+ ✅ Supported
9.x 8.0+ ✅ Supported
8.x 7.3+ ✅ Supported
7.x 7.3+ ✅ Supported
6.x 7.3+ ✅ Supported

Contributing

Pull requests are welcome. For substantial changes, please open an issue first to discuss the direction.

Bug reports and feature ideas → GitHub Issues.

Credits

License

The MIT License (MIT). See LICENSE for details.


All versions of laravel-query-filter with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
illuminate/console Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oooiik/laravel-query-filter contains the following files

Loading the files please wait ...