Download the PHP package shevabam/meilisearch-light-php-client without Composer
On this page you can find all versions of the php package shevabam/meilisearch-light-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shevabam/meilisearch-light-php-client
More information about shevabam/meilisearch-light-php-client
Files in shevabam/meilisearch-light-php-client
Package meilisearch-light-php-client
Short Description Meilisearch Light PHP Client
License
Homepage https://github.com/shevabam/meilisearch-light-php-client
Informations about the package meilisearch-light-php-client
Meilisearch Light PHP Client
Meilisearch Light PHP Client is a PHP library for using a Meilisearch server in PHP.
PHP 5.6+ compatible unlike official clients (meilisearch-php and meilisearch-symfony) that allow PHP 7.4 or 8.0.
Requirements
- Meilisearch server URL
- Search API Key
- Admin API Key
Installation
With Composer, run this command:
composer require shevabam/meilisearch-light-php-client
Usage
Request
First, include the library in your code using the Composer autoloader:
Then, create an MeilisearchLightClient object with some paremeters:
Make a call:
The call
method takes as a parameter:
- the parameters (see below)
- the HTTP method (GET, POST, PUT, ...)
- the endpoint (corresponds to the Meilisearch query)
- the data to transmit: can be a file (must start with @) or an array
The parameters allow you to specify the API key to use (search or admin) as well as the headers if necessary:
Response
To check that a request is valid, use the isOk()
method:
By default, the return is an object. To get an array:
Examples
List of indexes:
Adding documents to an index via a file
Adding documents to an index via an array
Search
Resources
All versions of meilisearch-light-php-client with dependencies
ext-json Version *