guywarner / laravel-singlestore-fulltext
Package to use SingleStore DB's match() function for full text search adding Model::match()->get() to Models
Installs: 4 357
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 2
Requires
- php: ^8.1
- illuminate/contracts: ^9.0
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2023-08-11 17:55:52 UTC
README
A simple package to add match() function to Laravel models
User::match(['first_name', 'last_name'], 'Guy Warner')->get()
Installation
You can install the package via composer:
composer require guywarner/laravel-singlestore-fulltext
Add your FULLTEXT index. If the index is missing SDB will error with:
Can't find FULLTEXT index matching the column list
Extend the model you want to search:
use Guywarner\LaravelSinglestoreFulltext\Models\SingleStoreModel; class Mopdel extends SingleStoreModel { }
Usage
Model::match(['column1', 'column2'], 'search term')->get();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.