Releases: devaction-labs/filterable-package
Releases · devaction-labs/filterable-package
v2.0.2
What's Changed
- fix(Filter): add ILIKE operator support and wildcard pattern by @alexnogueirasilva in #35
Full Changelog: v2.0.1...v2.0.2
v2.0.1
What's Changed
- fix: add support for pre-computed tsvector columns by @alexnogueirasilva in #34
Full Changelog: v2.0.0...v2.0.1
Release v2.0.0 - Full-Text Search & PHP 8.3+ Migration
🚀 Major Features
Full-Text Search Filter
Added intelligent full-text search capabilities with automatic database adapter:
- PostgreSQL: Native full-text search using
to_tsvector(),to_tsquery(), and GIN indexes (10-100x faster!) - MySQL/SQLite: Automatic fallback to LIKE operator across multiple columns
- Language Support: Configurable stemming for Portuguese, English, Spanish, French, and more
- Prefix Matching: Control whether partial words match
- High-Performance: Support for pre-computed
search_vectorcolumns with GIN indexes
Usage Example:
// Search across multiple columns
Filter::fullText(['name', 'description', 'tags'], 'search')
->setFullTextLanguage('portuguese')
// High-performance with GIN index (PostgreSQL)
Filter::fullText('search_vector', 'q')
->setDatabaseDriver('pgsql')
Performance:
- Regular columns: ~500ms on 1M rows
- search_vector with GIN index: ~5ms on 1M rows (100x faster!)
Configuration via Environment:
# .env
FULLTEXT_LANGUAGE=portuguese
// config/app.php
'fulltext_language' => env('FULLTEXT_LANGUAGE', 'simple'),
// Now use without specifying language
Filter::fullText(['title', 'content'], 'search')
⚠️ Breaking Changes
PHP Version Requirement
PHP 8.2 has been discontinued. This package now requires PHP 8.3, 8.4, or 8.5.
Migration:
# Update your PHP version
sudo apt install php8.3 # Linux
brew install php@8.3 # macOS
# Update composer.json
"require": {
"php": "^8.3"
}
# Update dependencies
composer update
Why?
- Better performance with PHP 8.3+ optimizations
- Access to new language features (typed class constants, readonly amendments)
- Security improvements and active support
- Better type system for improved code quality
📦 What's Changed
...v1.1.4
What's Changed
- chore(pagination): rename $type param to $paginationType by @alexnogueirasilva in #29
Full Changelog: v1.1.3...v1.1.4
Add CursorPaginate
What's Changed
Added
- Cursor Pagination Support: Added support for cursor-based pagination for improved performance on large datasets
customPaginate()now accepts three pagination types:'paginate','simple', and'cursor'- Cursor pagination ideal for infinite scroll implementations
- Simple pagination option for better performance when total count is not needed
Changed
- BREAKING:
customPaginate()method signature updated fromcustomPaginate(bool $useSimplePaginate, ?array $data)tocustomPaginate(string $type = 'paginate', ?int $perPage = null, ?array $data = null)- Migration: Change
->customPaginate(false, $data)to->customPaginate('paginate', null, $data) - Migration: Change
->customPaginate(true, $data)to->customPaginate('simple', null, $data)
- Migration: Change
- Code refactoring: Removed all
elsestatements in favor of early returns and guard clauses for improved readability - Improved README documentation with comprehensive pagination examples
Fixed
- Optimized
collectConditions()method by removing unnecessary size estimation loop
Full Changelog: v1.1.1...v1.1.3
🚀 [v1.1.1] - Caching Support and Performance Improvements
What's Changed
- ci(workflows): update workflows and add release validation by @alexnogueirasilva in #25
- fix: correct action SHAs and remove version from composer.json by @alexnogueirasilva in #26
- refactor: remove automatic release job from workflow by @alexnogueirasilva in #27
Full Changelog: v1.0.24...v1.1.1
v1.1.0
Added
- New Filter Types: Added 7 new commonly used filter types
ilike()- Case-insensitive LIKE with database-specific handling (PostgreSQL ILIKE, SQLite LIKE, MySQL LOWER())notEquals()- NOT EQUALS (!=) filter for excluding specific valuesnotIn()- NOT IN filter for excluding multiple values from a listnotLike()- NOT LIKE filter for excluding text patternsisNull()- IS NULL filter for checking null valuesisNotNull()- IS NOT NULL filter for checking non-null valuesstartsWith()- STARTS WITH filter using LIKE with % suffixendsWith()- ENDS WITH filter using LIKE with % prefix
Enhanced
- Database Compatibility: Improved database-specific handling for different SQL dialects
- PostgreSQL: Uses native ILIKE for case-insensitive searches
- SQLite: Falls back to LIKE for case-insensitive searches
- MySQL: Uses LOWER() function for case-insensitive comparisons
- Filter Value Processing: Enhanced
prepareValue()method to handle new filter types- Automatic pattern generation for STARTS_WITH and ENDS_WITH
- Support for comma-separated values in NOT_IN filters
- Pattern application for NOT_LIKE filters
Testing
- Comprehensive Test Coverage: Added complete test suite for all new filter types
- Unit tests for each new filter type
- Database driver detection tests
- Operator validation tests
- Integration tests with Filterable trait
Performance
- Optimized Query Building: Enhanced
applyFilterToBuilder()method- Direct method calls for null checks (whereNull/whereNotNull)
- Efficient handling of negation filters (whereNotIn)
- Streamlined LIKE pattern processing
Release v1.0.24
Release v1.0.24
Please refer to the CHANGELOG.md for details.
Release v1.0.23
Release v1.0.23
Please refer to the CHANGELOG.md for details.
Release v1.0.22
Release v1.0.22
Please refer to the CHANGELOG.md for details.