Download the PHP package dmarte/filterable without Composer

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

Filterable

A Laravel library to handle filters for Eloquent models or Scout database records with a single API.

  1. How it works
  2. Implementation
  3. Pagination
  4. Reserved query string parameters
  5. Limiting the Full-Text columns check
  6. Filterable queries
  7. Resource response

How it works

Filterable automatically will perform the required implementation to fetch records from an eloquent model. At first, will try to check if want to perform a Laravel Scout search, or a full eloquent model search.

It also supports Full text search.

Implementation

Pagination

Filterable package by default will return a collection of records, if you would like to get the paginator format you must include the query string paginator=true in the request.

With ?paginator=false response will be:

With ?paginator=true response will be:

Reserved query string parameters

In order to change the expected results in search, filterable check with params you have in your request.

Parameter Default Description Example
with_trashed false Allow to include deleted records in the result set. ?with_trashed=true
per_page 15 Determine the number or records to get in the query. ?per_page=20
with null An array or string with the list of model relations to include. with[]=relation1&with[]=relation2
search null A string to activate the full-text search support. ?search=John%sdoe
paginator false Enable or disable the paginator format in data response.

Limiting the Full-Text columns check

By specifying the list of columns that should be full-text searchable you can globally search based on generic criterea.

Filterable queries

You could create your own logic for each column when you override the method filterableQueries.

IMPORTANT

You must be sure to return an instance of Illuminate\Support\Collection with each callback. The filterable engine will check the "key" on the collection to match the request "key", then will expect each value should be a callback function that perform your desired query.

Here is an example

Resource response

You could change the resource class used as response using the function qualifiedResource. With this static function you return the path of your resource.

NOTE By default it will take the name of the model with the suffix Resource. Eg. for \App\Models\User model will try to find \App\Http\Resources\UserResource.

You can change this behavior overriding that function.

Filter by multiple models

Useful for global searches you could create a multi-model filter.


All versions of filterable with dependencies

PHP Build Version
Package Version
Requires laravel/scout Version ^8.6
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 dmarte/filterable contains the following files

Loading the files please wait ....