Download the PHP package brnrajoriya/laravel-queryflow without Composer

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

QueryFlow for Laravel

Tests Latest Version

QueryFlow turns any Eloquent model into a complete REST list endpoint - pagination, sorting, keyword search, filters, relations, counts and aggregates - from one whitelist on the model.

Created by Bhaskar Rajoriya. QueryFlow started in 2020 as the addOperationsInQuery() helper used across production Laravel projects, and is now a tested, open-source package.


Why QueryFlow

Installation

Requires PHP 8.3+ and Laravel 12.40+ or 13.

Declaring what a model exposes

With the attribute:

Or with properties:

List Used by Default
filterable filter, operations, select, group_by, aggregates key + fillable + timestamps, minus $hidden
sortable order_by filterable
searchable keyword (relation.column searches a relation) none
includable with, with_count, where_has, has, doesnt_have none

Using it

get() returns:

Request Result
default LengthAwarePaginator
pagination=simple Paginator (no COUNT(*) query)
pagination=cursor CursorPaginator (fastest for large tables / infinite scroll)
return_type=count int
return_type=sum\|avg\|min\|max + aggregate_column int\|float
any aggregate + group_by [['status' => 'draft', 'count' => 4], ...]

Extend QueryFlowRequest to add your own rules:

Query parameters

Parameter Example Notes
page 2
per_page 25 default 25, max 100 (configurable)
pagination paginate | simple | cursor cursor uses the cursor parameter
order_by views or views,title sortable only; key is added as tie breaker
order_type desc or desc,asc one value for all columns, or one per column
keyword laravel case-insensitive; % and _ are literal
filter[col] filter[status]=published equals; filter[status][]=a&filter[status][]=b = in
operations[] see below up to 25, nested up to 3 levels
select title,views or select[]=title key and needed foreign keys are added automatically
with author,comments or author.company includable only
with_count comments adds comments_count
trashed with | only models using SoftDeletes
return_type data | count | sum | avg | min | max
aggregate_column views required for sum / avg / min / max
group_by status only with an aggregate return_type

Every name can be changed in config/queryflow.php ('order_by' => 'sort_by') to match an existing frontend.

Operations

Parameters Codes
column, operator, value where, or_where, where_date, where_month, where_day, where_year, where_time
column, values[] where_in, where_not_in, or_where_in, or_where_not_in
column, values[2] where_between, or_where_between, where_not_between, or_where_not_between
column where_null, where_not_null, or_where_null, or_where_not_null
column_1, operator, column_2 where_column, or_where_column
relation (+ optional column/operator/value) where_has, or_where_has, has, doesnt_have
operations[] group, or_group

Operators: =, !=, <>, <, <=, >, >=, like, not like (configurable).

Existing projects can keep calling addOperationsInQuery($query, $operations).

Security

Performance tips

Testing

Credits & license

QueryFlow is created and maintained by Bhaskar Rajoriya (LinkedIn).

Released under the MIT License: free to use in personal and commercial projects. Please keep the copyright notice. If QueryFlow helps your project, a mention of "QueryFlow by Bhaskar Rajoriya" or a GitHub star is appreciated - GitHub's "Cite this repository" button uses CITATION.cff.

A ready-to-use API that uses QueryFlow: Laravel API Boilerplate.


All versions of laravel-queryflow with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework Version ^12.40|^13.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 brnrajoriya/laravel-queryflow contains the following files

Loading the files please wait ...