Download the PHP package aw-studio/laravel-model-index without Composer

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

Laravel Model Index

image

Overview

This package provides an easy to use Query Builder to filter, sort, search, and paginate Laravel models.

Usage

Install the package via composer:

The model to which the index endpoint refers must have the following trait added:

Filtering

The Index Query Builder supports filtering from query parameters nearly out of the box. All you have to do is to configure which model attributes are filterable. This can be done when using the index in the controller:

Or if you'd like to resue the Index multiple times and always have the same filter options enabled, you may add a filterable property or method to the Model which should return an array attribute names.

Filtering the index list is now as simple as adding the query parameter “filter” to the URL with the attribute name as the key and a value. For example:

Advanced Filtering

For more sophisticated filters, you may use operators and logical operators in the query parameters. For example:

The following operators are supported:

Logical operators can be used to combine filters. For example:

The following logical operators are supported:

Custom Filters

By default filter keys are supposed to match the column names of the model. You can also define custom filter keys by using the filter method on the Index query and define custom callbacks for the filter. This also allows you to use model scopes for filtering or more complex queries e.g. in related models.

Sorting

You can sort the index using query parameters. For example:

You can also sort in descending order:

Multiple columns can be sorted by separating them with a comma:

Searching

You can search the index using query parameters. For example:

This will search all configured columns for the term "John".

Configuring Searchable Columns

To configure which columns should be searchable, use the searchable method on the Index query:

Pagination

You can automatically paginate the index using query parameters by adding the page query parameter to the URL or setting a per_page value in the query parameters. For example:

License

This project is licensed under the MIT License. See the LICENSE file for details.


All versions of laravel-model-index with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version ^11
illuminate/http Version ^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 aw-studio/laravel-model-index contains the following files

Loading the files please wait ....