ipunkt / laravel-indexer-client by rokde

A php client for the laravel-indexer-service
1,114
0
3
Package Data
Maintainer Username: rokde
Maintainer Contact: rok@ipunkt.biz (Robert Kummer)
Package Create Date: 2017-07-20
Package Last Update: 2019-03-15
Language: PHP
License: MIT
Last Refreshed: 2024-04-19 15:04:34
Package Statistics
Total Downloads: 1,114
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

laravel-indexer-client

Latest Stable Version Latest Unstable Version License Total Downloads

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);
        }
    });
}