Installation
Install Laravel Search Syntax Parser, publish its configuration, and prepare the database features your searches use.
Install the package with Composer and run its install command. Composer also installs Search Syntax Parser, the core package that parses the queries.
Requirements
Laravel Search Syntax Parser requires PHP 8.4 or later and Laravel 13. It supports SQLite, MySQL, MariaDB, and PostgreSQL.
Install the package
Install the package with Composer:
composer require hosmelq/laravel-search-syntax-parserRun the install command to publish config/search-syntax-parser.php:
php artisan search-syntax-parser:installLaravel discovers the service provider automatically. See configuration for the available options.
Publish files manually
You can also publish the configuration without the install command:
php artisan vendor:publish --tag=search-syntax-parser-configTo customize validation messages, publish the translations:
php artisan vendor:publish --tag=search-syntax-parser-translationsSee validation errors for adding another locale.
Prepare the database
Ordinary column filters need no additional setup. The features below have database requirements:
| Feature | Requirement |
|---|---|
| JSON columns | SQLite JSON functions. MySQL arrays use JSON_TABLE(). MariaDB arrays and dynamic keys use JSON_TABLE(), which requires MariaDB 10.6 or later. PostgreSQL supports json and jsonb. |
| Full-text search | A separate FULLTEXT index per target column on MySQL or MariaDB, or a matching GIN expression index on PostgreSQL. SQLite requires likeFallback(). |
| Dates | Stored datetimes and the database session time zone must agree with the application's storage zone. |
Install the Boost skill
The package ships a Laravel Boost skill that shows AI agents how to define, apply, and test searches. If your application uses Boost, run its installer and select hosmelq/laravel-search-syntax-parser among the third-party packages:
php artisan boost:installRun php artisan boost:update after updating the package to refresh the skill.
Next steps
Review the configuration, then define a search.