PHPackages                             datalumo/laravel - 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. [Search &amp; Filtering](/categories/search)
4. /
5. datalumo/laravel

ActiveLibrary[Search &amp; Filtering](/categories/search)

datalumo/laravel
================

Laravel integration for Datalumo - Scout-inspired searchable models

0.2.0(1mo ago)020↓90%MITPHPPHP ^8.2

Since Mar 25Pushed 1mo agoCompare

[ Source](https://github.com/datalumo/laravel)[ Packagist](https://packagist.org/packages/datalumo/laravel)[ RSS](/packages/datalumo-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (16)Versions (6)Used By (0)

datalumo for Laravel
====================

[](#datalumo-for-laravel)

A Scout-inspired Laravel integration for [datalumo](https://datalumo.app). Automatically sync your Eloquent models to Datalumo collections and search them via integrations with a fluent API.

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

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

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

[](#installation)

```
composer require datalumo/laravel
```

Publish the config file:

```
php artisan vendor:publish --tag=datalumo-config
```

Add your API token to `.env`:

```
DATALUMO_TOKEN=your-api-token
```

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

[](#configuration)

The published config file (`config/datalumo.php`) includes:

```
return [
    'token' => env('DATALUMO_TOKEN', ''),
    'url' => env('DATALUMO_URL', 'https://datalumo.app'),
    'queue' => env('DATALUMO_QUEUE', true),
    'queue_connection' => env('DATALUMO_QUEUE_CONNECTION'),
    'queue_name' => env('DATALUMO_QUEUE_NAME'),
    'chunk_size' => 50,
];
```

By default, indexing operations are queued. Set `DATALUMO_QUEUE=false` to sync synchronously.

Making models searchable
------------------------

[](#making-models-searchable)

Add the `Searchable` trait to your Eloquent model and implement `toSearchableText()`:

```
use Datalumo\Laravel\Searchable;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use Searchable;

    protected string $datalumoCollectionId = 'your-collection-uuid';
    protected string $datalumoIntegrationId = 'your-integration-uuid';

    public function toSearchableText(): string
    {
        return $this->title . "\n\n" . $this->body;
    }
}
```

The model requires two properties:

- `$datalumoCollectionId` — the collection where entries are synced to (data management)
- `$datalumoIntegrationId` — the integration used for search, summarise, and chat

### Customising what gets indexed

[](#customising-what-gets-indexed)

Override these optional methods to enrich your entries:

```
public function toSearchableTitle(): ?string
{
    return $this->title;
}

public function toSearchableMeta(): ?array
{
    return ['author' => $this->author->name];
}

public function toSearchableSourceUrl(): ?string
{
    return route('articles.show', $this);
}
```

### Conditional indexing

[](#conditional-indexing)

Control which models get indexed:

```
public function shouldBeSearchable(): bool
{
    return $this->is_published;
}
```

Models that return `false` are automatically removed from Datalumo if they were previously indexed.

Automatic syncing
-----------------

[](#automatic-syncing)

Once a model uses the `Searchable` trait, it automatically syncs to Datalumo on create, update, delete, soft delete, and restore.

### Manual syncing

[](#manual-syncing)

```
$article->searchable();
$article->unsearchable();

Article::where('is_published', true)->get()->searchable();
```

Searching
---------

[](#searching)

### Basic search

[](#basic-search)

```
$articles = Article::search('machine learning')->get();
```

Returns an Eloquent Collection of matching models, searched via the integration.

### Pagination

[](#pagination)

```
$articles = Article::search('machine learning')->paginate(15);
```

### Fluent options

[](#fluent-options)

```
$articles = Article::search('transformers')
    ->threshold(0.3)
    ->meta(['category' => 'ai'])
    ->paginate(10);
```

### Raw results

[](#raw-results)

Get the raw Datalumo `Entry` objects without mapping to Eloquent models:

```
$entries = Article::search('machine learning')->raw();
```

AI features
-----------

[](#ai-features)

### Summarise

[](#summarise)

```
$summary = Article::search('explain machine learning')->summarise();

echo $summary->summary;
echo $summary->references;
```

### Chat

[](#chat)

```
$response = Article::search('What is machine learning?')->chat();

echo $response->message;
echo $response->conversationId;

// Continue the conversation
$followUp = Article::search('What about deep learning?')
    ->chat($response->conversationId);
```

Streaming
---------

[](#streaming)

The summarise and chat methods have streaming variants that return text chunks as they are generated:

```
$stream = Article::search('What is your refund policy?')->streamChat();

foreach ($stream->text() as $chunk) {
    echo $chunk;
    flush();
}
```

```
$stream = Article::search('explain this')->streamSummarise();

foreach ($stream->text() as $chunk) {
    echo $chunk;
    flush();
}
```

Get the full text at once:

```
$stream = Article::search('hello')->streamChat();
$fullResponse = $stream->fullText();
```

Use with Laravel's streaming response:

```
Route::get('/chat', function () {
    $stream = Article::search(request('message'))->streamChat();

    return response()->stream(function () use ($stream) {
        foreach ($stream->text() as $chunk) {
            echo $chunk;
            ob_flush();
            flush();
        }
    }, 200, ['Content-Type' => 'text/plain']);
});
```

Blade components
----------------

[](#blade-components)

Embed Datalumo widgets directly in your views:

### Chatbot

[](#chatbot)

```

```

### Search box

[](#search-box)

```

```

With a custom target and form:

```

```

### Search modal

[](#search-modal)

Opens with `Ctrl+K` / `Cmd+K`:

```

```

With a custom target to control where the modal is rendered:

```

```

Publish views to customise:

```
php artisan vendor:publish --tag=datalumo-views
```

Artisan commands
----------------

[](#artisan-commands)

### Import

[](#import)

```
php artisan datalumo:import "App\Models\Article"
```

### Flush

[](#flush)

```
php artisan datalumo:flush "App\Models\Article"
```

Queue configuration
-------------------

[](#queue-configuration)

```
DATALUMO_QUEUE=true
DATALUMO_QUEUE_CONNECTION=redis
DATALUMO_QUEUE_NAME=indexing
```

Set `DATALUMO_QUEUE=false` for synchronous indexing during development.

Testing
-------

[](#testing)

In your tests, mock the `Engine` to prevent API calls:

```
use Datalumo\Laravel\Engine;

$engine = Mockery::mock(Engine::class);
$engine->shouldReceive('update')->andReturnNull();
$engine->shouldReceive('delete')->andReturnNull();

$this->app->instance(Engine::class, $engine);
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

Every ~12 days

Total

4

Last Release

55d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66ca71465f93459010e10f39821b541f1c00c61233c48bcda0cea8a8d6fb6988?d=identicon)[jeffreyvr](/maintainers/jeffreyvr)

---

Top Contributors

[![jeffreyvr](https://avatars.githubusercontent.com/u/9550079?v=4)](https://github.com/jeffreyvr "jeffreyvr (9 commits)")

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k53.0M584](/packages/laravel-scout)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.9M203](/packages/illuminate-broadcasting)[illuminate/notifications

The Illuminate Notifications package.

483.0M1.1k](/packages/illuminate-notifications)[laravel/ai

The official AI SDK for Laravel.

9782.1M161](/packages/laravel-ai)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)

PHPackages © 2026

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