Download the PHP package koba/filter-builder-core without Composer

On this page you can find all versions of the php package koba/filter-builder-core. 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 filter-builder-core

Filter Builder Core

A flexible, type-safe PHP library for creating and applying filters to objects. Filter Builder Core allows you to define filterable fields, parse filter criteria from arrays (typically JSON/API requests), validate them, and execute complex filtering logic against your domain objects.

Features

Installation

Install via Composer:

Quick Start

Core Concepts

Configuration

The Configuration class is the central point for defining what can be filtered. It manages rules and relations.

You can optionally provide a translation object and custom bound filter factory:

Constraint Types

Filter Builder Core supports three constraint types:

Operations

Available filter operations:

Adding Rule Entries

Define filterable fields using addRuleEntry():

With custom validation:

Adding Relation Entries

Filter based on related objects:

Filter Array Format

Filters are defined as arrays with a specific structure:

Group Filter

Rule Filter

For ONE_OF operations, provide an array:

Relation Filter

Complex Example

This translates to: (category = 'Electronics' OR category = 'Books') AND price < 100 AND inStock = true

Validation and Error Handling

The library provides comprehensive validation with detailed error messages.

Validation Exception

When filter validation fails, a ValidationException is thrown:

Common Validation Errors

Internationalization

The library supports multiple languages for error messages.

Using Built-in Translations

Creating Custom Translations

Implement the Translationinterface:

Advanced Usage

Working with Collections

Filter multiple objects:

Custom Bound Filter Factory

For advanced use cases, you can create a custom bound filter factory:

Strategy Pattern

The library uses the strategy pattern for extensibility. Currently, ObjectStrategy is provided for filtering objects, but you can implement custom strategies:

Development

Static Analysis

The library uses PHPStan for static analysis:

Configuration is in phpstan.neon.

Support

For issues, questions, or suggestions, please open an issue on the GitHub repository.


All versions of filter-builder-core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.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 koba/filter-builder-core contains the following files

Loading the files please wait ...