https://github.com/ipunkt/laravel-indexer-client
A php client for the laravel-indexer-service
https://github.com/ipunkt/laravel-indexer-client
Last synced: about 1 year ago
JSON representation
A php client for the laravel-indexer-service
- Host: GitHub
- URL: https://github.com/ipunkt/laravel-indexer-client
- Owner: ipunkt
- License: mit
- Created: 2017-07-20T15:29:44.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-15T08:39:37.000Z (over 7 years ago)
- Last Synced: 2025-02-07T05:27:31.510Z (over 1 year ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-indexer-client
[](https://packagist.org/packages/ipunkt/laravel-indexer-client) [](https://packagist.org/packages/ipunkt/laravel-indexer-client) [](https://packagist.org/packages/ipunkt/laravel-indexer-client) [](https://packagist.org/packages/ipunkt/laravel-indexer-client)
A php client for the [laravel-indexer-service](https://github.com/ipunkt/laravel-indexer-service).
## Installation
```bash
composer require ipunkt/laravel-indexer-client
```
If you need a < php7 release use the 1.* version.
### Binding in Laravel
In any ServiceProvider do the following:
```php
public function register()
{
$this->app->bind(IndexerClient::class, function () {
$host = config('indexer.service');
$token = config('indexer.token');
try {
$httpClient = new Client();
$client = new IndexerClient($host, $httpClient, $token);
return $client;
} catch (Exception $exception) {
throw new \RuntimeException('IndexerClient can not be instantiated.', 0, $exception);
}
});
}
```