Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Scout Typesense Driver

Laravel Scout Typesense Driver Laravel Package

typesense/laravel-scout-typesense-driver

A Typesense driver for Laravel Scout that brings fast, typo-tolerant full-text search, faceting, filtering, geo search, and synonyms to Eloquent models. Swap Scout's default engine for Typesense with simple configuration and a native Laravel integration for scalable, relevant app search.

View on GitHub
Deep Wiki
Context7

Laravel Scout Driver for Typesense

Frequently asked questions about Laravel Scout Typesense Driver
How do I install the Typesense driver for Laravel Scout?
Install it with Composer using composer require typesense/laravel-scout-typesense-driver alongside laravel/scout, then publish the Scout config file. Add the Typesense connection block to config/scout.php or the environment variables the driver reads, and set the Scout driver to typesense. Finally, add the Searchable trait and a toSearchableArray() method to each model and run php artisan scout:import to build the collections.
Which Laravel, Scout, and PHP versions does this driver support?
The driver targets modern Laravel stacks, with the technical assessment scoping Laravel 9+ and PHP 8.1+ alongside laravel/scout. Because the package has a single-track release cadence and its latest release was April 2024, verify the composer.json constraints against your exact Laravel and Scout major versions before adopting it. Pin the driver major version to the Scout major and run CI against each supported Laravel version.
Do I need a separate Typesense server to use this driver?
Yes. The driver is only the Laravel-side engine, so you must run a Typesense node, typically Docker Compose locally and Typesense Cloud or Kubernetes in production. That adds a stateful service to your deployment topology, which is reasonable when search is a first-class concern but overkill for tiny datasets where Scout's database driver is enough.
How do I configure the Typesense connection in Laravel?
Publish Scout's configuration and populate the typesense block with host, port, protocol, and your API key, usually sourced from environment variables. You also supply a search-only key for client-facing queries so browsers never see an admin key. The driver reads these values through Laravel's config layer, so per-environment overrides work as usual.
How do I make an Eloquent model searchable with Typesense?
Add the Searchable trait to the model, implement searchableAs() to name the collection, and define toSearchableArray() to control which fields are indexed and their types. Then run php artisan scout:import to create the collection and load existing records. After that, Model::search() returns Typesense-backed results through Scout's familiar query builder.
Does indexing happen automatically on save and delete, or do I need scout:import?
Scout's Searchable trait hooks model events, so creates, updates, and deletes are pushed to Typesense as queued jobs once you have workers running. Bulk loading existing rows is a separate step done with php artisan scout:import. If your queue is down, indexing silently lags, so monitor backlog and consider synchronous indexing only for low-volume cases.
Can I use faceting, filtering, and geo search through this driver?
Yes. The driver translates Scout's query contract into Typesense search parameters, so faceting, filtering, typo tolerance, synonyms, and geo search are available. Some advanced Typesense capabilities such as curations, multi-search, and vector or hybrid search may only be partially surfaced through Scout, in which case you can call typesense/typesense-php directly for edge cases.
What happens if I change a model's toSearchableArray()?
Typesense collections have typed schemas, so changing toSearchableArray() requires a reindex rather than a database migration. Plan to drop and recreate the collection, then re-import, and design your field types deliberately up front. Treat schema changes as deploy events that need staging validation.
How does this driver compare to Scout's Algolia or Meilisearch engines?
It plugs into the same Scout Engine contract as the Algolia and Meilisearch drivers, so migrating between them is mostly configuration and reindexing rather than rewriting search code. That makes it a strong fit if your app already uses Scout and Model::search(). If you are currently on raw SQL LIKE queries or an Elasticsearch-specific client, though, adopting Scout itself is the real refactor, not the driver.
Is the package production-ready, and what should I watch out for?
It is MIT licensed with no legal friction and integrates cleanly, but the ecosystem is small, around 145 stars, and releases have been single-track, so pin versions deliberately. Search uptime now depends on a separate cluster, so decide whether graceful degradation is required and use search-only or per-tenant scoped keys where clients query directly. Baseline latency and error rates, shadow-compare against your legacy path, and flip reads per model behind a feature flag.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections