src/ServiceProvider.php
/**
     * Register the service provider.
     *
     * @return void
     */
Register the service provider.
@return void
Register the service provider . @return void
public function register()
    {
        $configPath = __DIR__.'/../config/elasticsearch.php';
        $this->mergeConfigFrom($configPath, 'elasticsearch');
        $this->app->singleton('elasticsearch', function ($app) {
            $clientFactory = array_get(
                $app['config'],
                'elasticsearch.clientFactory',
                [
                    ClientFactory::class,
                    'make'
                ]
            );
            return call_user_func($clientFactory, $app);
        });
    }
public function register ( ) { $ configPath = __DIR__ . '/../config/elasticsearch.php' ; $ this -> mergeConfigFrom ( $ configPath , 'elasticsearch' ) ; $ this -> app -> singleton ( 'elasticsearch' , function ( $ app ) { $ clientFactory = array_get ( $ app [ 'config' ] , 'elasticsearch.clientFactory' , [ ClientFactory :: class , 'make' ] ) ; return call_user_func ( $ clientFactory , $ app ) ; } ) ; }
Register the service provider.
Register the service provider .