Download the PHP package pointybeard/laravel-filterable-model without Composer

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

Laravel Filterable Model

Add filtering via http request query params to Eloquent models in Laravel

Installation

Usage

Extend your Eloquent models with Pointybeard\FilterableModel\AbstractFilterableModel and then use the trait Pointybeard\FilterableModel\Traits\FilterableTrait. This will add a new scope called filter, as well as the following methods, to your model:

Then, add protected properties $filterable, $sortable, $sortByDefault, and $sortOrderDefault to control the behaviour of filtering. E.g.

Finally, you can use the ->filter() scope to filter results by passing an instance of Filter. E.g.

Alternatively, use the Filter::fromRequest() method to build a filter from request query params, e.g. in your controllers like so:

By default, all comparisons are done by injecting an equals (=) where clause into the database calls. To use other comparisons, or add more complex logic, create a new class that extends Pointybeard\FilterableModel\Filter and add your own methods. For example, to use a LIKE comparison for your tag field and a boolean comparison for is_published:

Contributing

We encourage you to contribute to this project. Please check out the Contributing documentation for guidelines about how to get involved.

Support

If you believe you have found a bug, please report it using the GitHub issue tracker.

Authors

License

"Laravel Filterable Model" is released under the MIT License. See LICENCE for details.


All versions of laravel-filterable-model with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.0
illuminate/database Version ^9.17 || ^10.23
illuminate/http Version ^9.17 || ^10.23
illuminate/support Version ^9.17 || ^10.23
spatie/laravel-data Version ^3.9
webmozart/assert Version ^1.11
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 pointybeard/laravel-filterable-model contains the following files

Loading the files please wait ....