chaplean/elasticsearch-bundle
config/elasticsearch.php), but lacks Laravel’s native service binding (e.g., ElasticsearchManager facade).elasticsearch/elasticsearch PHP client (v7+), which Laravel projects already use directly or via packages like spatie/laravel-elasticsearch.config/ structure.spatie/laravel-elasticsearch).spatie/laravel-elasticsearch (1.5k stars) or elastic/elasticsearch-php directly?AppKernel.php and relies on service providers (AppServiceProvider) for bundle-like functionality.elasticsearch/elasticsearch PHP client (v7+), which Laravel already supports.config/elasticsearch.php or environment variables.ElasticsearchServiceProvider) to register the Elasticsearch client and index configurations.// app/Providers/ElasticsearchServiceProvider.php
public function register()
{
$this->app->singleton(ElasticsearchClient::class, function ($app) {
return Elasticsearch\ClientBuilder::create()
->setHosts([$app['config']['elasticsearch.host']])
->build();
});
}
config.yml index definitions to Laravel’s config/elasticsearch.php:
'indexes' => [
'products' => 'ecommerce_products',
'users' => 'user_profiles',
],
Elasticsearch) to wrap client operations, mirroring the bundle’s intended API.// app/Facades/Elasticsearch.php
public static function index($key) {
return self::client()->index(self::config("indexes.$key"));
}
AppKernel will need Laravel equivalents (e.g., service provider boot methods).elasticsearch/elasticsearch via Composer.Elasticsearch::index('products')->create()).elasticsearch/elasticsearch usage is well-documented; reverting is straightforward.elasticsearch/elasticsearch and the bundle’s expected version.try-catch).How can I help you explore Laravel packages today?