Download the PHP package plokko/querable-resource without Composer

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

QuerableResource

A Laravel class that helps querying(paging and filtering) and returning Eloquent resources from Ajax.

Supports Laravel 5.5 Resources.

Installation

Install it throught composer composer require plokko/querable-resource

Quick start

First of all you need to extend the Plokko\QuerableResource\QuerableResource class implementing the getQuery method that returns the base query:

Next we're going to instantiate it and return it to the request

The page should return a basic resource with all the results

Pagination

To enable pagination edit the $paginate protected propriety or via the pagination() method setting it to the wanted page size or to null to disable it.

The propriety $paginations specify the user-selectable available values, if the value is null only $paginate user values will be discarted in favor of $paginate, if an int value is specified it will be set as the maxium value (in this case the user could select pagination up to 100 with default of 30 items per page); if an array (of integers) is specified the user value must be contained in the array or $paginate value will be used (ex. [10,20,30,50] )

Filtering results

To filter results extend the protected propriety $filteredFields specifying what fields you want to filter

You do not need to pass anything to the resource, the filtering is automatic and transparent.

By default the comparison is done with the LIKE 'value%'; for example the page /test?name=a will search all the user with a name starting with 'a'.

Alias

If you want to use a query parameter different from the field you can specify the alias as key for the field:

Advanced filtering options

Instead of the field name you can specify an array of filtering options like

Changing query field name

If you want to group all filtering field in an input group, for example filter[filed_name], you need to edit the protected propriety $filterQueryParameter

The url of the last example will now be /test?filter[name]=a

Define filtering rules

Custom filtering function

If your query needs a more fine-tuning you can override the default filter function and specify your custom filtering function:

Don't worry, pagination and query field name will also be automatically applied to your filtering, no need to implement them!

Returning custom resource

If you want to filter the results with a custom resource you can do it by simply specifying the name of your Resource class in the protected field $useResource:

The class will now return the specified resource (as a collection); for further detail on resources see Laravel 5.5 API resources doc.

Javascript integration

This plugin contains some Javascript assets to help integrate with the php counterpart.

This plugin includes two main helper:


All versions of querable-resource with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
illuminate/support Version ^5.4.0|^6.0|^7.0|^8.0|^9.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 plokko/querable-resource contains the following files

Loading the files please wait ....