ipunkt / laravel-indexer-client
A php client for the laravel-indexer-service
Installs: 1 114
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- rokde/http-client: ^1.1
README
A php client for the laravel-indexer-service.
Installation
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:
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); } }); }