Download the PHP package crazynds/query-pipeline without Composer
On this page you can find all versions of the php package crazynds/query-pipeline. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download crazynds/query-pipeline
More information about crazynds/query-pipeline
Files in crazynds/query-pipeline
Package query-pipeline
Short Description A query pipeline for use with custom search in Laravel project.
License MIT
Homepage https://github.com/crazynds/QueryPipeline-Laravel
Informations about the package query-pipeline
Query Pipeline Description
This package contains a collection of class that can be used with Laravel Pipeline.
Can do the same as the package pipeline-query-collection however the syntax differs, and gives the user a little more possibilities.
Allows you to implement conditionals for joins and add where clauses if certain data was passed.
Installation
You can install the package via composer:
Usage
See the example below:
Steps
- First add the trait QueryPipeline from Crazynds\QueryPipeline\QueryPipeline to your class.
- Setup your middleware stack variable
- Send the base query, your data values and your stack to $this->runPipeline and the query pipeline will run.
- Be happy :>
Middlewares
A middleware in this context means a step in which the query will be processed. See all the middlewares in folder src/middleware.
Each middleware has your stack of parameters, see below the specifications:
Join Query
The join query middleware add a join query based on conditions passed as parameters. Each join query can include multiples joins.
The base object recived by each iten in array is represented below:
The on array is limited to only simple verification, without multiple wheres. Because of this, the array recive only 3 parameter, the left column, the comparator, and the right column.
The checkParameters array, if not defined, the join will be added to query every time. If defined, the join will only be added to array if any of the string in the array is a key of array data;
ILIKE Query
The ilike query middleware add a where in the query with a comparation of type LIKE no case sensitive. The query add automatically the % in the start and end the string in the value.
The base object recived by each iten in array is represented below:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of query-pipeline with dependencies
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.9.2