Download the PHP package hashemi/queryfilter without Composer

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

Laravel QueryFilter

A simple & dynamic package for your eloquent query in laravel. It will help you to write query logic individual for each parameter.

Installation

You can start it from composer. Go to your terminal and run this command from your project root directory.

Usage

Suppose you want use query-filters on User model for query. Laravel QueryFilter provide Filterable trait . You need to use it on your model. It will add a scope filter on your model. Like,

Now, you need to create your query filter file where you will write sql logic to generate sql by passing parameter. You can create your filter file by using command,

This command will create Filters directory on your app/ directory. So, you can find the file on app/Filters/UserFilter.php. Every method of filter class, represent your passing parameter key. You need to pass your parameter snake case and your method name will be like apply<ParamterName>Property format. Property name must be write in Pascal case.

After create that file, when you use your model on you controller to query something, you need to use your scope and pass UserFilter class as a parameter. You controller will be look like,

If you want to pass your custom queries on filter, you can also do that in your filter,

And on your app\Filters\UserFilter.php file, you can do something like it,

That's it.

Convention

Caveat

If your request & provided array to the filter scope cannot find any suitable method, then it'll return the whole table data as select * from your_table. Be aware of this issue.

Contributing

Pull requests are welcome. For any changes, please open an issue first to discuss what you would like to change.


All versions of queryfilter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
illuminate/database Version >=6.0
illuminate/support Version >=6.0
illuminate/http Version >=6.0
illuminate/console Version >=6.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 hashemi/queryfilter contains the following files

Loading the files please wait ....