Download the PHP package kayckmatias/z-filters without Composer

On this page you can find all versions of the php package kayckmatias/z-filters. 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 z-filters

zFilters

a simple package to filter your Laravel models without repetitive loops or various if-else

Version Total Downloads License

Installation

You can install the package via composer:

Usage

You just need two things: make a new filter and create a scope in your model to point filter.

To make a new Filter:

Example:

Example new Filter Image

and configure your filter options according to your preference (read here)

Now, is need make a scope in your model, example:

Configure

zFilters supports three filters type: simple, relation and complex.

Simple Filters:

Simple Filter is a whereIn condition, when you make a simple filter you is saying.

Let's assume that your user table has the column "department_id", to make a simple filter you just need to reference how the name of the filter option will be, let's call it "departments" and the column, which would be "department_id"

Now the array of values or single value you send in $filters['departments'] will be filtered in whereIn condition on the simple filter

Relation Filters:

Relation Filter is a whereIn condition in a relation, when you make a relation filter you is saying.

Let's assume that your User model has the relation with department (departments()), to create a relationship filter where we must get all the users that the department belongs to manager 1 or 2 we can do this:

Now the array of values or single value you send in $filters['departments_manager'] will be filtered in whereIn condition in departments relation on manager_id column.

Complex Filters

The complex filter can deal with more specific conditions, it accepts a callback function and you can filter however you want, let's go to another example. Assuming your same user table has a name column and a summary column and you expect to do a complex search for both conditions by value, one way to do it would be:

The complex filter option named 'search' will execute the function, the value of $q will be the query builder being formed and the second parameter, $filterValue will be automatically implemented to what is sent in $filters['search'], as it is a callback function you can work on it too, manipulate the values sent, as if it were inside the query builder itself.

License

The MIT License (MIT). Please see License File for more information


Made with ♥ by Kayck Matias


All versions of z-filters with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 kayckmatias/z-filters contains the following files

Loading the files please wait ....