Download the PHP package teamq/laravel-datatables without Composer

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

Laravel Datatable API

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is a collection of classes for filters and sorts, extending from the spatie/laravel-query-builder package, in addition to providing the possibility of applying these filters and sorting in related models using join through from the kirschbaum-development/eloquent-power-joins package.

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Usage

Pagination

This package uses Laravel pagination by default; However, it allows you to specify through parameters of queries, the number of records to obtain, you can even obtain all the records.

It is recommended to use the result method instead of paginate or get. Since result encapsulates the logic of both yes, it is requested to show all, below result will use get but if you want to see a number of records below will use paginate with the amount provided.

Filters

Filter Class Operators
Text TeamQ\Datatables\Filters\TextFilter Text
Number TeamQ\Datatables\Filters\NumberFilter Number
Date TeamQ\Datatables\Filters\DateFilter Number
Global TeamQ\Datatables\Filters\GlobalFilter -
HasRelationship TeamQ\Datatables\Filters\HasRelationshipFilter -
Text comparison operators | Comparison operator | Key | |---------------------|---------------| | Equal | $eq | | Not Equal | $notEq | | Start With | $startWith | | Not Start With | $notStartWith | | End With | $endWith | | Not End With | $notEndWith | | Contains | $contains | | Not Contains | $notContains | | In | $in | | Not In | $notIn | | Filled | $filled | | Not Filled | $notFilled |
Number comparison operators | Comparison operator | Key | |-----------------------|-------------| | Equal | $eq | | Not Equal | $notEq | | Greater Than | $gt | | Greater Than Or Equal | $gte | | Less Than | $lt | | Less Than Or Equal | $lte | | Between | $between | | Not Between | $notBetween | | In | $in | | Not In | $notIn | | Filled | $filled | | Not Filled | $notFilled |

You can use advanced filters that have support for multiple comparison operators. The available comparison operators are located in TeamQ\Datatables\Enums\Comparators

To use these advanced filters, just call them as custom filters:

If you want to handle relationships using join, you must pass false as the first parameter to the filter and pass the type of join to use.

Text Filter

The following example uses the comparison operator $endWith isbn 54213

Number Filter

The following example uses the comparison operator $in 1, 5 or 9

For this example an array of values was used. Arraying values is supported by all types of operators (text and number).

Date Filter

The following example uses the comparison operator $notBetween, created at 2019-08-01 and 2019-08-10

For this example an array of values was used. Arraying values is supported by all types of operators (text and number).

Global Filter

The global filter implements general search functionality for the model and its relationships.

This is not a global search engine between entities!!! For that you can use the package spatie/laravel-searchable

To use this filter, you must pass the model fields to be filtered or their relationships.

Has Relationship Filter

This filter accepts two possible values:

Use this filter when you want the user to be able to filter on records that have associated models/relationships, For example, you may be interested in obtaining all authors who have books.


Sorts

Sort Class
Relation TeamQ\Datatables\Sorts\RelationSort
Case TeamQ\Datatables\Sorts\CaseSort

RelationSort

To sort by fields of related tables you must use join, there is no easy way to do it from eloquent, so you can use RelationSort, this class receives the type of join as a parameter.

CaseSort

If you use enums or states, where each enum or state is represented by a number, you may want to sort by name of that enum or state and not by the number, then you can use CaseSort.

You must pass an array [$key => $value], which will be used to generate the sort.

As a second parameter you can specify the type of Join that you want to use, if the ordering is by the field of a related model. By default, it is Inner Join.

Testing

Can use docker-compose to run

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-datatables with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
kirschbaum-development/eloquent-power-joins Version ^3.2
spatie/laravel-package-tools Version ^1.14.0
spatie/laravel-query-builder Version ^5.2|^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 teamq/laravel-datatables contains the following files

Loading the files please wait ....