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
Typesense Php

Typesense Php Laravel Package

typesense/typesense-php

Official PHP client for the Typesense API. Install via Composer with a HTTPlug-compatible HTTP client, then search, index, and manage collections using full Typesense features. Includes filter value escaping and compatibility notes for server versions.

View on GitHub
Deep Wiki
Context7

typesense/typesense-php is the official PHP client for the Typesense API, offering idiomatic access to collections, documents, search, and administrative endpoints. It uses HTTPlug for HTTP abstraction, so you can install a supported client such as php-http/curl-client.

  • Full coverage of core Typesense API operations
  • Pluggable HTTP clients via HTTPlug
  • FilterBy::escapeString() for safe filter_by values
  • Documented server-version compatibility
  • Examples under doc/examples and linked API docs
Frequently asked questions about Typesense Php
Is typesense/typesense-php a Laravel package with a service provider and facade?
No. typesense/typesense-php is the official framework-agnostic PHP client for the Typesense REST API; it ships no Laravel service provider, facade, config publishing, or Eloquent integration. For Laravel Scout integration you install the separate typesense/laravel-scout-typesense-engine driver instead. The client is best treated as a low-coupling dependency behind your own SearchService or repository interface.
How do I install typesense/typesense-php with Composer?
Run composer require php-http/curl-client typesense/typesense-php, or add typesense/typesense-php to your composer.json. The extra php-http/curl-client package is required because the client relies on HTTPlug and you must supply a compatible HTTP client. After installation, read the Typesense API docs and the doc/examples folder in the repository.
Which HTTP client should I use with the Typesense PHP client?
typesense/typesense-php uses HTTPlug (php-http) as its HTTP abstraction layer, so you must install a supported HTTPlug or PSR-18 client. The README recommends php-http/curl-client, but other supported clients and adapters work too. This lets you centralize HTTP middleware, retries, and logging in shared infrastructure you already operate.
Which Typesense server version do I need for typesense-php v6?
typesense-php v6.x requires Typesense server v30.0 or newer; v5.x requires server v28.0 or newer, and v4.9 requires v26.0 or newer. The client version is therefore determined by the server version you can actually run, not the other way around. Check the compatibility table before upgrading either side.
How do I use Typesense with Laravel Scout?
Use the separate typesense/laravel-scout-typesense-engine package, which provides the Laravel Scout driver. typesense/typesense-php is the lower-level official PHP client and does not integrate with Scout or Eloquent by itself. If you adopt Scout, you own a four-way compatibility matrix across Laravel, Scout, the client, and the Typesense server.
How do I safely escape user input in filter_by with the Typesense PHP client?
Use Typesense\FilterBy::escapeString() on string values before concatenating them into a filter_by expression; it is available from v6.1.0. User-supplied filter_by values are a genuine injection surface, so escaping should be a mandated coding standard rather than an optional nicety. Concatenate the escaped value into the filter expression instead of hand-rolling quotes.
Does typesense/typesense-php support multi-search, geo search, synonyms, and curation?
Yes. The client covers collections and schema updates, batch document import and partial updates, aliases, synonyms, curation sets, stopwords, stemming dictionaries, scoped API keys, analytics events, conversations, multi-search, and geo search. Because it mirrors the REST API closely, feature coverage tracks the Typesense server you run. Version v6.1.0 also adds the /operations/schema_changes endpoint.
Is typesense-php safe under Laravel Octane and queue workers?
Pin at least v5.2.0. That release replaced static node state with instance-based nodes and added node shuffling to avoid thundering-herd retries, which matters under Octane, queue workers, and multi-tenant configurations. v5.2.0 also introduced retry-on-500/408, so older pins lack transport resilience as well.
What breaking changes should I check before upgrading typesense-php?
Review the changelog every time; this is not a safe blind composer update. v6.0.0 carries Typesense server v30 breaking changes, and v5.0.0 changed URL-encoding behavior so resource names are now auto-encoded, meaning apps that pre-encode will double-encode. Confirm your server version matches the client before upgrading.
Is typesense/typesense-php actively maintained and safe to depend on?
Yes. It is the official vendor-maintained PHP client, Apache-2.0 licensed, with active releases, and it is a thin stateless HTTP façade over the REST API. That keeps exit or fork costs low, and the vendor commitment is a stronger adoption signal than star count or Packagist dependent metrics. The bigger risks are operational, since search becomes a new stateful service to run, monitor, back up, and upgrade.
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