PHPackages                             directorytree/opensearch-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. directorytree/opensearch-client

ActiveLibrary[API Development](/categories/api)

directorytree/opensearch-client
===============================

A Laravel integration for the official OpenSearch PHP client

v1.0.0(1mo ago)17062MITPHPPHP ^8.2CI passing

Since Jun 22Pushed 1mo agoCompare

[ Source](https://github.com/DirectoryTree/OpenSearchClient)[ Packagist](https://packagist.org/packages/directorytree/opensearch-client)[ RSS](/packages/directorytree-opensearch-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (2)

OpenSearch Client
=================

[](#opensearch-client)

A Laravel integration for the official [OpenSearch PHP client](https://github.com/opensearch-project/opensearch-php).

Installation
------------

[](#installation)

Install the package with Composer:

```
composer require directorytree/opensearch-client
```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="DirectoryTree\OpenSearchClient\OpenSearchClientServiceProvider"
```

The published `config/opensearch-client.php` file defines the default connection and any named OpenSearch connections:

```
return [
    'default' => env('OPENSEARCH_CONNECTION', 'default'),

    'connections' => [
        'default' => [
            'base_uri' => env('OPENSEARCH_HOST', 'http://localhost:9200'),
        ],
    ],
];
```

Each connection is passed directly to `OpenSearch\GuzzleClientFactory`.

Usage
-----

[](#usage)

Resolve `DirectoryTree\OpenSearchClient\OpenSearchManager` from the container to access OpenSearch clients:

```
namespace App\Console\Commands;

use DirectoryTree\OpenSearchClient\OpenSearchManager;
use Illuminate\Console\Command;

class CreateIndex extends Command
{
    protected $signature = 'create:index {name}';

    protected $description = 'Creates an index';

    public function handle(OpenSearchManager $opensearch): void
    {
        $client = $opensearch->default();

        $client->indices()->create([
            'index' => $this->argument('name'),
        ]);
    }
}
```

You can also resolve named connections:

```
$client = $opensearch->connection('write');
```

You may also use the facade:

```
use DirectoryTree\OpenSearchClient\Facades\OpenSearch;

$client = OpenSearch::connection('write');
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6dd082636ff8a08df8dfdcd622ea242374d1d76dd33bceec5a6cd3ae26dc24f?d=identicon)[stevebauman](/maintainers/stevebauman)

---

Top Contributors

[![stevebauman](https://avatars.githubusercontent.com/u/6421846?v=4)](https://github.com/stevebauman "stevebauman (3 commits)")

---

Tags

phpclientlaravelopensearch

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/directorytree-opensearch-client/health.svg)

```
[![Health](https://phpackages.com/badges/directorytree-opensearch-client/health.svg)](https://phpackages.com/packages/directorytree-opensearch-client)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.3k](/packages/craftcms-cms)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5222.6k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1349.3k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
