ashiqfardus/laravel-fuzzy-search
composer require) and minimal setup (publish config if needed). Fluent API reduces boilerplate.pg_trgm may outperform MySQL’s LIKE for fuzzy logic).LIKE '%term%' is slow). Mitigation: Use database-specific optimizations (e.g., PostgreSQL’s tsvector) or precompute search indices.pg_trgm extension)? If not, what’s the fallback plan?pg_trgm extension (enable via CREATE EXTENSION pg_trgm).LIKE or custom algorithms; may need full-text indexes for large tables.LIKE queries) against the package’s algorithms.similar_text() in PHP) for accuracy.LIKE queries first (e.g., %term%).GIN index on tsvector).str_contains/str_starts_with usage).composer require ashiqfardus/laravel-fuzzy-search.php artisan vendor:publish --tag=fuzzy-search-config.where('column', 'LIKE', '%term%') with:
use AshiqFardus\LaravelFuzzySearch\FuzzySearch;
$results = Model::fuzzySearch('column')->where('term')->get();
config/fuzzy-search.php (e.g., set default_algorithm to levenshtein).tsvector).composer.json if long-term stability is critical.config/fuzzy-search.php overrides).ANALYZE in PostgreSQL) for fuzzy search columns.DB::enableQueryLog() to inspect generated SQL.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Database downtime | Search functionality fails | Implement fallback to exact match or gracefully degrade. |
| Slow fuzzy queries | Poor UX (timeouts, timeouts) | Add query timeouts, log slow queries, optimize indexes. |
How can I help you explore Laravel packages today?