Looking to hire Laravel developers? Try LaraJobs

laravel-indexer-client maintained by ipunkt

Description
A php client for the laravel-indexer-service
Author
Last update
2019/03/14 18:33 (dev-master)
License
Links
Downloads
1 118

Comments
comments powered by Disqus

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