Download the PHP package chr15k/laravel-meilisearch-advanced-query without Composer

On this page you can find all versions of the php package chr15k/laravel-meilisearch-advanced-query. 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-meilisearch-advanced-query

GitHub Workflow Status (master) Total Downloads Latest Version License


Meilisearch Advanced Query provides a fluent, expressive API for building Meilisearch filter expressions in Laravel — the same filters you'd otherwise write by hand when customising Scout engine searches.

It handles compound conditions, nested groups, range queries, geo filters, and Meilisearch-specific operators, keeping your code readable as queries grow in complexity.

[!WARNING] v3 contains breaking changes. If you are upgrading from v2, see the upgrade guide.


Requirements


Installation

The service provider is registered automatically via Laravel's package discovery.


Usage

Building a filter string

Use the Query facade (or resolve MeilisearchAdvancedQuery from the container directly) to build a filter string without touching Scout at all:

Running a Scout search

Chain forModel() on the query builder to hand off to Scout. This returns a Scout Builder instance that you can continue to chain as normal:

Sorting

Pass a sort expression (or array of expressions) to search():

For Meilisearch's sort syntax, see the sorting documentation.


The Query Facade

The Query facade proxies to a fresh MeilisearchAdvancedQuery instance on each call, so there is no shared state between requests.

You can also resolve the builder from the container directly if you prefer:


Builder Methods

where(field, operator, value, boolean)

The primary method. Operator defaults to Operator::EQ. Boolean defaults to AND.

orWhere(field, operator, value)

Identical to where() but joins with OR.

whereNot(field, value) / orWhereNot(field, value)

Negates a field equality check.

whereIn(field, values) / orWhereIn(field, values)

Matches any value in the given array.

whereNotIn(field, values) / orWhereNotIn(field, values)

Excludes any value in the given array.

whereBetween(field, from, to) / orWhereBetween(field, from, to)

Range filter using Meilisearch's TO operator.

whereExists(field) / orWhereExists(field)

Matches documents where the field exists.

whereIsNull(field) / orWhereIsNull(field)

Matches documents where the field is null.

whereIsEmpty(field) / orWhereIsEmpty(field)

Matches documents where the field is empty.

whereRaw(query) / orWhereRaw(query)

Passes a raw filter string through the compiler unchanged. Useful for filter expressions the builder does not yet support natively.

Geo filters

whereGeoRadius(lat, lng, distanceInMeters) / orWhereGeoRadius

whereGeoBoundingBox(lat1, lng1, lat2, lng2) / orWhereGeoBoundingBox


Nested / Grouped Queries

Pass a closure to where() or orWhere() to create a parenthesised group:

Groups can be nested to any depth:


Supported Operators

See the Meilisearch filter expression reference for full documentation on each operator.

Enum case Meilisearch syntax
Operator::EQ =
Operator::NEQ !=
Operator::GT >
Operator::GTE >=
Operator::LT <
Operator::LTE <=
Operator::IN IN
Operator::NOT NOT
Operator::BETWEEN TO
Operator::EXISTS EXISTS
Operator::NULL IS NULL
Operator::EMPTY IS EMPTY

Advanced: Using ScoutAdapter Directly

forModel() is a convenience wrapper around ScoutAdapter. If you need more control — for example, to swap in a custom compiler — you can instantiate ScoutAdapter directly:

ScoutAdapter validates at instantiation that the given class exists, is an Eloquent model, and uses the Searchable trait — throwing InvalidArgumentException if any check fails.


Debugging

Call compile() at any point in the chain to get the raw filter string without executing a search:


Architecture

The package is structured around four concerns:

The Compiler and Query contracts are independently extensible — you can implement your own compiler (for a different search engine's filter syntax) or your own query builder without touching the rest of the package.


Running Tests

Individual checks:


Resources


License

MIT — see LICENSE for details.


All versions of laravel-meilisearch-advanced-query with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^12.0|^13.0
laravel/scout Version ^11.0
meilisearch/meilisearch-php Version ^1.16
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 chr15k/laravel-meilisearch-advanced-query contains the following files

Loading the files please wait ...