Drop-in driver
A `matrixone` driver built on Laravel's MySQL stack. Read/write splitting, reconnects and lazy connections work like any built-in driver.
Use MatrixOne as a drop-in Laravel database — Eloquent, Query Builder, Schema Builder, migrations and transactions.
MatrixOne has native FULLTEXT indexes (BM25 or TF-IDF ranking, an ngram parser for Chinese, Japanese and Korean). The package exposes them in two ways.
For models stored in MatrixOne. Create the index in a migration and query it like any Laravel full-text search, with relevance ranking:
Schema::create('articles', function (Blueprint $table) {
$table->id(); // MatrixOne needs a primary key for FULLTEXT
$table->string('title');
$table->text('body');
$table->fullText(['title', 'body'])->parser('ngram'); // parser optional
});
Article::whereFullText(['title', 'body'], 'vector database')->get();
Article::searchFullText(['title', 'body'], $term)->limit(20)->get(); // filter + order by relevance
Article::select('id')->selectFullTextRelevance(['title', 'body'], $term, as: 'score')->get();
// Boolean queries: +must -exclude "phrases" prefix*
use MatrixOne\Support\FullTextQuery;
Article::searchFullText(['title', 'body'],
FullTextQuery::make()->must('laravel')->mustNot('legacy')->prefix('match')
)->get();
Article::searchFullText('body', FullTextQuery::anyOf($userInput))->get(); // any word, like a search boxSCOUT_DRIVER=matrixone searches the model's own MatrixOne table: full-text and LIKE columns, relevance ordering, and semantic or hybrid search on a vector column.
#[SearchUsingFullText(['title', 'body'])]
public function toSearchableArray(): array { /* ... */ }
Article::search('vector database')->get(); // full-text, by relevance
Article::search('how to store songs')->semantic()->get(); // cosine similarity
Article::search('songs')->hybrid()->get(); // rank fusion of bothSCOUT_DRIVER=matrixone-index uses a separate MatrixOne database as the search index, like Meilisearch or Algolia. Your models can stay in MySQL, PostgreSQL, CockroachDB or SQLite:
// config/scout.php
'matrixone-index' => [
'connection' => 'matrixone_search',
'index-settings' => [
Article::class => [
'fulltext' => ['title', 'body'],
'filterable' => ['status', 'author_id' => 'integer'],
'sortable' => ['published_at' => 'datetime'],
'fold_accents' => true, // "tieng viet" matches "Tiếng Việt"
'prefix' => true, // "learn" matches "learning"
'embedding' => 1536, // enables ->semantic() and ->hybrid()
],
],
],
Article::search('laravel')->where('status', 'published')->orderBy('published_at', 'desc')->paginate(20);Both packages store their data in the database, and both run on MatrixOne. Tests cover recording, aggregation, dashboards and pruning.
Pulse. The package binds a MatrixOne storage automatically when Pulse is installed. Publish its migration instead of Pulse's own, which MatrixOne rejects:
composer require laravel/pulse
php artisan vendor:publish --provider="Laravel\Pulse\PulseServiceProvider" --tag=pulse-config
php artisan vendor:publish --tag=matrixone-pulse-migrations
php artisan migrateKeep PULSE_STORAGE_DRIVER=database; pulse.storage.database.connection may point to a MatrixOne connection. The dashboard's aggregates, graphs and top lists work.
Telescope. No change needed: install it as usual, with its own migration.
composer require laravel/telescope
php artisan telescope:install
php artisan migrateThe database cache, queue and session drivers work too (CACHE_STORE=database, QUEUE_CONNECTION=database, SESSION_DRIVER=database).
scan / audit / copy commands to move an application to MatrixOne.