PHP code example of ipunkt / laravel-indexer-client

1. Go to this page and download the library: Download ipunkt/laravel-indexer-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ipunkt / laravel-indexer-client example snippets


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