Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
orchestra-versions: [ '8.0', '9.0', '10.0' ]
php-versions: [ '8.5', '8.4', '8.3', '8.2' ]
orchestra-versions: [ '11.0', '10.0', '9.0' ]
exclude:
- php-versions: 8.1
# Laravel 13 (Testbench 11) requires PHP >= 8.3
- php-versions: 8.2
orchestra-versions: 11.0
# Laravel 11 (Testbench 9) does not support PHP 8.5
- php-versions: 8.5
orchestra-versions: 9.0
- php-versions: 8.1
orchestra-versions: 10.0
- php-versions: 8.4
orchestra-versions: 8.0
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
php-version: 8.5
extensions: mbstring, dom, fileinfo, gmp, bcmath
coverage: xdebug

Expand Down Expand Up @@ -51,6 +51,6 @@ jobs:
run: vendor/bin/phpunit --colors --coverage-clover ./coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
composer.lock
.env
/cov
/.*
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0] - 2026-07-31

### Changed

- Requires PHP 8.2+ (PHP 8.1 is EOL, pin `1.0.*` to stay on it)
- Tested against PHP 8.5, CI matrix is now PHP 8.2 to 8.5 against Orchestra 9, 10 and 11
- `phpunit/phpunit` `^11.0|^12.0|^13.0`, `orchestra/testbench` `^9.0|^10.0|^11.0`

## [1.0.0] - 2026-02-21

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Searchable is not a replacement for a dedicated search engine — it's a lightwe

## Requirements

- PHP 8.1+
- PHP 8.2+
- Laravel 10.x / 11.x / 12.x
- MySQL / MariaDB or PostgreSQL
- `ext-intl` PHP extension
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
],
"require": {
"ext-intl": "*",
"php": "^8.1",
"php": "^8.2",
"fab2s/strings": "^1.0"
},
"require-dev": {
"ext-pdo": "*",
"phpunit/phpunit": "^10.0|^11.0",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"phpunit/phpunit": "^11.0|^12.0|^13.0",
"orchestra/testbench": "^9.0|^10.0|^11.0",
"laravel/pint": "^1.27",
"phpstan/phpstan": "^2.1"
},
Expand Down
8 changes: 4 additions & 4 deletions src/SearchQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ public function addMatch(Builder $query, string|array $search, string $tableAlia
$order = $order ? $this->getOrder($order) : $this->order;

if ($driver === 'pgsql') {
$query->whereRaw("to_tsvector('{$this->tsConfig}', {$searchField}) @@ to_tsquery('{$this->tsConfig}', ?)", [$terms]);
$query->whereRaw("to_tsvector('{$this->tsConfig}', {$searchField}) @@ to_tsquery('{$this->tsConfig}', ?)", [$terms]); // @phpstan-ignore argument.type

if ($order) {
$query->orderByRaw("ts_rank(to_tsvector('{$this->tsConfig}', {$searchField}), to_tsquery('{$this->tsConfig}', ?)) {$order}", [$terms]);
$query->orderByRaw("ts_rank(to_tsvector('{$this->tsConfig}', {$searchField}), to_tsquery('{$this->tsConfig}', ?)) {$order}", [$terms]); // @phpstan-ignore argument.type
}

return;
}

$query->whereRaw('MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)', [$terms]);
$query->whereRaw('MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)', [$terms]); // @phpstan-ignore argument.type

if ($order) {
$query->orderByRaw('(MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)) ' . $order, [$terms]);
$query->orderByRaw('(MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)) ' . $order, [$terms]); // @phpstan-ignore argument.type
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/DefaultSizeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

use fab2s\Searchable\SearchableInterface;
use fab2s\Searchable\Traits\Searchable;
use Illuminate\Database\Eloquent\Model;

class DefaultSizeModel extends \Illuminate\Database\Eloquent\Model implements SearchableInterface
class DefaultSizeModel extends Model implements SearchableInterface
{
use Searchable;
protected $table = 'models';
Expand Down
12 changes: 6 additions & 6 deletions tests/ListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ private static function supportsOptions(): bool
public function test_runs_enable_after_up_migration(): void
{
$mock = Mockery::mock();
$mock->shouldReceive('call') // @phpstan-ignore method.notFound
->once()
$mock->shouldReceive('call')
->once() // @phpstan-ignore method.notFound
->with('searchable:enable', [], Mockery::type(ConsoleOutput::class))
;
Artisan::swap($mock);
Expand Down Expand Up @@ -72,8 +72,8 @@ public function test_runs_when_pretend_is_false(): void
}

$mock = Mockery::mock();
$mock->shouldReceive('call') // @phpstan-ignore method.notFound
->once()
$mock->shouldReceive('call')
->once() // @phpstan-ignore method.notFound
->with('searchable:enable', [], Mockery::type(ConsoleOutput::class))
;
Artisan::swap($mock);
Expand All @@ -88,8 +88,8 @@ public function test_runs_when_options_missing_pretend(): void
}

$mock = Mockery::mock();
$mock->shouldReceive('call') // @phpstan-ignore method.notFound
->once()
$mock->shouldReceive('call')
->once() // @phpstan-ignore method.notFound
->with('searchable:enable', [], Mockery::type(ConsoleOutput::class))
;
Artisan::swap($mock);
Expand Down
3 changes: 2 additions & 1 deletion tests/NoTimestampModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

use fab2s\Searchable\SearchableInterface;
use fab2s\Searchable\Traits\Searchable;
use Illuminate\Database\Eloquent\Model;

class NoTimestampModel extends \Illuminate\Database\Eloquent\Model implements SearchableInterface
class NoTimestampModel extends Model implements SearchableInterface
{
use Searchable;
protected $table = 'no_timestamp_models';
Expand Down
Loading