Download the PHP package davidoc26/eloquent-filter without Composer

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

Eloquent Filters

Simple filter system for building queries

Latest Stable Version Total Downloads License PHP Version Require

Requirements

Installation

Introduction

Filters allow you to apply restrictions/rules to create a query. It's like middlewares.

There are two types of filters:

1) Filter 2) RequestFilter (gives you access to the Request instance)

Filters can also have their own arguments (using HasArguments trait)

Usage

Using Filterable

To start using filters, you need to use Filterable trait on your model.

To define filters, override the getFilters() method in your model and return the filters. If no filters have been defined, no filtering will be performed.

Creating new filter

To create a basic filter use the command:

This command will create a filter inside app/Filters directory.

Creating new RequestFilter

If you need a filter that has a Request instance available, create a RequestFilter:

Filter arguments

If you want your filter to have arguments (for example default values) use the HasArguments trait on your filter.

To set the arguments, specify them in your model's getFilters() method:

Then, you can get your arguments in your filter using dynamic properties

To see all the arguments you have defined in the model, use the getArguments() filter method

Filter Packs

Filter packs allows you to collect several filters in one pack. The main purpose of a filter pack is to apply the same filters to models.

To create a filter pack use command:

It will create filter pack in app/Filters/Packs directory:

Then you can apply filter pack to your model:

Applying Filters

To apply the filters specified in the getFilters() method, use filter() on your model.

To use only the filters you need, use the withFilters() method and pass the required filters into it, this method will ignore the filters that were specified in your model.


Post::withFilters([
    LoadRelationshipFilter::class,
    OffsetFilter::class
])->get();

All versions of eloquent-filter with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0
illuminate/container Version ^8.0 || ^9.0 || ^10.0
illuminate/database Version ^8.0 || ^9.0 || ^10.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 davidoc26/eloquent-filter contains the following files

Loading the files please wait ....