Download the PHP package apfelfrisch/query-filter without Composer

On this page you can find all versions of the php package apfelfrisch/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 query-filter

Query Filter

Unit tests Static Analysis Mutation tests

This Package provides a Framework agnostic Query Filter wich allows you to filter and sort queries based on the provided URL parameters. It comes with built-in adapters for Eloquent and Doctrine QueryBuilder, but can be extended to support other query building tools as well. The built-in URL parser supports basic JSON API functionality, and can be swapped out for a customized parser if needed.

Yet another query filter - but why?

I was searching for a query-filter that separates the criteria builder from the SQL builder, this way the criteria can be created in one location and then passed to another, which is useful for adding them into repositories. Additionally, I needed the capability to write custom QueryBuilderAdapter for different implementations, mainly for using it with In-Memory Repositories for testing purposes.

Installation

composer require apfelfrisch/query-filter

Basic Usage

Filter Users with the Name John

/users?filter[name]=John

Filter Users with the Name John or Doe

/users?filter[name]=John,Doe

Filter Users with name John and last name Doe

/users?filter[name]=John&filter[lastname]=Doe

Sort Users ascending by name

/users?sort=name

Sort Users ascending by name and descending created_at

/users?sort=name,-created_at

Allow only specfic fields

If needed, you can restrict the selected fields. If you do so, you must specify the fields via URI parameter. In the example below, only name and lastname will be selected.

/users?fields=name,lastname

Skipping forbidden criterias

By default, this package throws an exception if a filter or sort criteria is requested but not allowed. You can silently skip forbidden criterias like so:

Specify FilterCriteria

/users?filter[name]=John

Write a custom Filter

Your customer Filter has to implement the Filter interface. Concrete implementations can be found in the Criterias folder.

If you want to set your Filter as default, you can do it like so:

Write custom QueryParser

todo

Write custom QueryBuilderAdaper

todo


All versions of query-filter with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.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 apfelfrisch/query-filter contains the following files

Loading the files please wait ....