Download the PHP package mayoz/eloquent-filterable without Composer

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

Eloquent Filterable

With this package, you can optimize query clauses calling before or after the filter. You can manage your queries from a single interface.

Installation

PHP 5.5.9+ or HHVM, and Composer are required.

To get the latest version of Eloquent Filterable, simply add the following line to the require block of your composer.json file:

You'll then need to run composer install or composer update to download it and have the autoloader updated. Or use to shortcut installed through terminal:

Usage

  1. Create your query filters.
  2. Create your Eloquent models.
  3. Define Filterable trait and use the query filters in the Eloquent model.

Create Filters

All filters should be extend Mayoz\Filter\Filter abstract class. Thus, can be used before and after methods in your filters.

The Before Method

The before method responsible to position the head of the WHERE clause of the query. For example; we need published = 1 of query WHERE clause. However, this clause would like to work on before the other clauses.

The After Method

The after method responsible to position the end of the WHERE clause of the query. For example, if need status = 'active' of query WHERE clause. However, this clause would like to work on after the other clauses.

Create Model

Create your model file. If you want to manage queries add the Filterable trait your model file. And than, assign the all associative filters to $filters variable. Consider the following example:

Important: The order of the filter is important when adding (if need multiple before or after filters) query clause. The before filters are added the head of the clause according to the reference sequence. Likewise, the after filters.

Debug

Now the Post model is ready to use. You ready? Okay, we're testing the query. Don't forget to enable the query logging for examine the model queries.

Query logging output:

Why Use?

For example, you might want to show only the approved text of the visitors on the site. However, administrators can see them all. Create a new extended filter:

Hocus, pocus! Visitors will display only the active posts. But administrator display all. Ok?

Contributing

Love innovation and simplicity. Please use issues all errors or suggestions reporting. Follow the steps for contributing:

  1. Fork the repo.
  2. Follow the Laravel Coding Style.
  3. If necessary, check your changes with unittest.
  4. Commit all changes.
  5. Push your commit and create a new PR.
  6. Wait for merge the PR.

Unit Test

Please create your tests and check before PR. Use the command:

License

Eloquent Filterable is licensed under The MIT License (MIT).


All versions of eloquent-filterable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/database Version 5.1.*
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 mayoz/eloquent-filterable contains the following files

Loading the files please wait ....