Download the PHP package thejawker/laravel-interrogator without Composer

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

Just Ask, And We'll Get It For You

Latest Version on Packagist

Installation

Require the package from Composer:

Usage

You can interrogate() any Laravel Model in a Controller. Basic setup is easy peasy but does not provide proper security. Security can be added where needed.

Filtering

You can use filters to add where clauses to your query builder. A filter is depicted by the filter[column]=value variable.

Wildcard Filter

You can use wildcard operators in string filters. It is possible to create fairly complex filters this way.

List Filter

A comma-seperated list can be used as a filter. This will in turn run a whereIn on the QueryBuilder.

Note that you can currently not combine this with the wildcard filter as follows: jpg,pn*.

And or Or

You can specify the select's and or or conditions.

For example if you want to fetch Users with a gmail email address AND and a Dutch mobile phone numbers, you could do the following.

By default the or operator is used, however you are free to explicitly

Math Operations

It is possible to use a variety of different math operators in a filter.

Operator Math Operator Name Example
ge >= Greater or equal filter[price]=[ge]500
gt > Greater than filter[price]=[gt]500
le <= Less or equal filter[price]=[le]500
lt < Less than filter[price]=[lt]500

Of course you can combine this with the And or Or operator.

Default filters

It is possible to conveniently set default filters on the Interrogator. These can be overriden by the api consumer (client). Under the hood it will set the filter to the request.

If you want you can filter the QueryBuilder beforehand as well.

Null Filter

Sometimes you need to make sure a column is null. You can for example do the following:

Security

For some models you might want to prevent filtering on certain columns. The way you do this is by allowing a selection of fields. A not allowed filter will throw an error.

NOTE: nested filters are currently not supported.

Sorting

Sorting works according to the JSON spec by using the sort parameter on the request with the column name as a value.

You can sort by asc:

You can also sort by descending by adding a hyphen -:

Security

Like filtering there's some security baked in to the package. You can allow certain sorting columns by adding ->allowSortBy(['email']) onto the Interrogator.

Default sorting

Also default sorting can be defined on the Interrogator. Like the filtering; this is added on the request.

Chain shortcuts

You can keep chaining on with the Interrogator. Pagination and get are made shortcuts allowing you to do the following.

Your Life Made Easy

The interrogate() helper function tries to make your life easier by allowing various types. We try to solve your intent when you enter one of the following types.

Alternatives

For everything is a really nice Spatie package. I needed to be able to do some math specific operations that were not supported in the mentioned package.

Test

License

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


All versions of laravel-interrogator with dependencies

PHP Build Version
Package Version
Requires php Version ~7.4|^8.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 thejawker/laravel-interrogator contains the following files

Loading the files please wait ....