PHPackages                             vinothkumar/laravel-qdrant - 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. [Database &amp; ORM](/categories/database)
4. /
5. vinothkumar/laravel-qdrant

ActiveLibrary[Database &amp; ORM](/categories/database)

vinothkumar/laravel-qdrant
==========================

A Laravel-friendly wrapper for Qdrant vector DB

0131Blade

Since Jun 1Pushed 11mo agoCompare

[ Source](https://github.com/vinothkumar95/laravel-qdrant)[ Packagist](https://packagist.org/packages/vinothkumar/laravel-qdrant)[ RSS](/packages/vinothkumar-laravel-qdrant/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Qdrant
==============

[](#laravel-qdrant)

A Laravel-friendly wrapper for the Qdrant vector database. This package allows you to interact with Qdrant API easily using a Laravel-style API.

Requirements
------------

[](#requirements)

- PHP `^8.2`
- Guzzle `^7.8.0` (version `7.9.3` installed)
- Symfony UID `^7.3`

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

[](#installation)

```
composer require vinothkumar/laravel-qdrant
```

For modern Laravel versions (5.5+), the service provider and facade are auto-discovered. You typically do not need to manually add them to your `config/app.php`.

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

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --provider="Vinothkumar\Qdrant\QdrantServiceProvider" --tag="config"
```

This will publish a `qdrant.php` file to your `config` directory. Set your Qdrant configuration in your `.env` file:

```
QDRANT_HOST=http://localhost:6333
QDRANT_API_KEY=your_api_key_here
QDRANT_TIMEOUT=30
```

Available configuration options:

- `host`: The URL of your Qdrant instance (e.g., `http://localhost:6333`).
- `api_key`: Your Qdrant API key, if required (optional, defaults to `null`).
- `timeout`: Request timeout in seconds for Guzzle client (optional, defaults to `10`).

Usage
-----

[](#usage)

You can use the `Qdrant` facade or inject the `Vinothkumar\Qdrant\Services\QdrantService` class where needed.

### Collection Management

[](#collection-management)

```
// Create a collection
Qdrant::createCollection('products', [
    'size' => 1536,
    'distance' => 'Cosine'
]);

// Get collection info
$info = Qdrant::getCollection('products');

// List all collections
$collections = Qdrant::listCollections();

// Delete a collection
Qdrant::deleteCollection('products');
```

### Points Management

[](#points-management)

```
// Insert a single point
Qdrant::insert('products', 'product-123', [0.23, 0.44, 0.98], [
    'name' => 'Product Name',
    'category' => 'Electronics'
]);

// Batch insert multiple points
$points = [
    [
        'id' => 'product-124',
        'vector' => [0.24, 0.45, 0.97],
        'payload' => ['name' => 'Another Product', 'category' => 'Home']
    ],
    [
        'id' => 'product-125',
        'vector' => [0.25, 0.46, 0.96],
        'payload' => ['name' => 'Third Product', 'category' => 'Office']
    ]
];
Qdrant::batchInsert('products', $points);

// Update vectors
Qdrant::updateVectors('products', [
    [
        'id' => 'product-123',
        'vector' => [0.26, 0.47, 0.95]
    ]
]);

// Delete points
Qdrant::deletePoints('products', ['product-123', 'product-124']);

// Get points by IDs
$points = Qdrant::getPoints('products', ['product-125']);
```

### Search and Recommendations

[](#search-and-recommendations)

```
// Basic vector search
$results = Qdrant::search('products', [0.22, 0.43, 0.95], 10);

// Search with filters
$results = Qdrant::search('products', [0.22, 0.43, 0.95], 10, [
    'must' => [
        ['key' => 'category', 'match' => ['value' => 'Electronics']]
    ]
]);

// Recommendations based on existing points
$recommendations = Qdrant::recommend('products', ['product-125'], [], 5);
```

### Scrolling and Counting

[](#scrolling-and-counting)

```
// Scroll through points
$page = Qdrant::scroll('products', 20);
$nextPage = Qdrant::scroll('products', 20, $page['result']['next_page_offset']);

// Count points
$count = Qdrant::count('products');

// Count with filter
$count = Qdrant::count('products', [
    'must' => [
        ['key' => 'category', 'match' => ['value' => 'Electronics']],
    ],
]);
```

### Payload Indexing

[](#payload-indexing)

```
// Create an index on a payload field
Qdrant::createFieldIndex('products', 'category', 'keyword');

// Delete a field index
Qdrant::deleteFieldIndex('products', 'category');
```

Development &amp; Contributing
------------------------------

[](#development--contributing)

This project uses several tools to ensure code quality and consistency.

### Available Composer Scripts

[](#available-composer-scripts)

- `composer test`: Runs the PHPUnit test suite.
- `composer lint`: Checks for PHP coding standards issues using PHP-CS-Fixer (dry run with diff).
- `composer format`: Automatically fixes PHP coding standards issues using PHP-CS-Fixer.
- `composer analyse`: Performs static analysis using PHPStan to find potential bugs.

### Tools

[](#tools)

- **PHPUnit**: For unit and integration testing.
- **PHP-CS-Fixer**: For enforcing coding standards. Configuration is in `.php-cs-fixer.dist.php`.
- **PHPStan**: For static code analysis. Configuration is in `phpstan.neon.dist`.

Contributions are welcome! Please ensure your code adheres to the coding standards and that all tests pass.

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/462c1a7f382c258fd92ce89e566fe1d80974d1fffb41fc453b8dffd4a2ec8a71?d=identicon)[vinothkumar95](/maintainers/vinothkumar95)

---

Top Contributors

[![vinothkumar95](https://avatars.githubusercontent.com/u/120662401?v=4)](https://github.com/vinothkumar95 "vinothkumar95 (2 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/vinothkumar-laravel-qdrant/health.svg)

```
[![Health](https://phpackages.com/badges/vinothkumar-laravel-qdrant/health.svg)](https://phpackages.com/packages/vinothkumar-laravel-qdrant)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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