Download the PHP package mattsplat/table-queries without Composer

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

Laravel Table Queries

Contents

What Is It?

Setup

Sorting

Searching

Relationships

Filters

What Is It?

If you need to view your data in table or similar format that combines data from relational models and you need perforance that the client side can't provide. With a large dataset it can become too slow for the client to render so we can use server side rendering. If we rely on data that is from a relational table it can be tricky to filter, search or sort by this data. This package is aimed at making this easier.

Say you have the following database structure

You might need to display a table of users with a column for company name, total number of sales and total amount of sales in the last year.

You can define the company name as a simple belongs to relationships with company|name as company_name'. This is formatted relation|column as alias. The relation must be defined on the model. This will add company_name to the select statement allowing it to be filtered or sorted.

For total sales we can use sales|count(*) as sales_count

In total sales in the last year we want to get the sum of all the sales by using

This works similar to using

but instead of adding the entire relation as nested object it adds a field that can be added to orderBy or where or accessed like a property of the model.

Setup

To install with composer run composer require mattsplat/table-queries

For each query a class that implements TableQueryable is created. This class would typically called from a controller.

Sorting

The TableQueryBuilder class accepts options orderBy and ascending which can be passed as part of the setOptions method.

or the order method can be called directly and passed a s arguments

In either case if ascending is not provided then the default order will be desc

Searching

You can search text across many fields even relations fields using the search option.

or can be called directly

Relationships

Relationships can be loaded using the normal with method but this won't work if you need to sort or filter by this data. With an easy to read syntax you can add basic relational data to the query itself.

Filters

A filter can be called for an specific column using sql like syntax. Filter array can be passed in the options array in the format filter=column:operator:value

Available Operators Include

Since this doesn't read directly from the request if your request format differs it can modified before sending to the class.

Example get request /users?filter[id]=nin:9&filter[name]=like:S%


All versions of table-queries with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
illuminate/database Version ^6.0
illuminate/console Version ^5.5|^6.0
ext-json Version *
nesbot/carbon Version ^2.24
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 mattsplat/table-queries contains the following files

Loading the files please wait ....