From 601be5436e95e2a21a0b80a1a69e3885d98c3aed Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Fri, 9 Feb 2024 09:47:56 +0000 Subject: [PATCH] feat: add support for Laravel 11 --- .github/workflows/static.yml | 2 +- .github/workflows/tests.yml | 10 ++++++---- CHANGELOG.md | 7 ------- README.md | 2 +- RELEASE.md | 9 --------- composer.json | 20 ++++++++++---------- src/FilterQuery.php | 12 ++++++------ src/ModelFilter.php | 1 - 8 files changed, 24 insertions(+), 39 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 RELEASE.md diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 3e1c4a2..4937a98 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -11,7 +11,7 @@ jobs: name: PHPStan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 579a46a..2fe76aa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,18 +15,20 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2] - laravel: [10.*] - stability: [prefer-lowest, prefer-stable] + php: [8.2, 8.3] + laravel: [10.*, 11.*] + stability: [prefer-stable] include: - laravel: 10.* testbench: 8.* + - laravel: 11.* + testbench: 9.* name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 012a2e3..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Changelog - -All notable changes to `laravel-filters` will be documented in this file. - -## 1.0.0 - 202X-XX-XX - -- initial release diff --git a/README.md b/README.md index 74db81a..a16bd1f 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ composer test ## Changelog -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. +Please see [GitHub Releases](https://github.com/worksome/laravel-filters/releases) for more information on what has changed recently. ## Contributing diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 1b868eb..0000000 --- a/RELEASE.md +++ /dev/null @@ -1,9 +0,0 @@ -# Release instructions - -The following steps should be performed each and every time a new release is made. - -1. Switch to the `main` branch in your local installation -2. Run `git pull` to get the latest code changes -3. Edit [CHANGELOG.md](CHANGELOG.md) following the [Keep a Changelog](https://keepachangelog.com) convention -4. Run `git commit -m "docs: update CHANGELOG" && git push` -5. Run `git tag vX.X.X && git push --tags`, replacing `X` with the appropriate version number diff --git a/composer.json b/composer.json index 4383427..387db5a 100644 --- a/composer.json +++ b/composer.json @@ -17,19 +17,19 @@ ], "require": { "php": "^8.2", - "illuminate/contracts": "^10.0", - "illuminate/database": "^10.0", - "spatie/laravel-package-tools": "^1.14.1", - "tucker-eric/eloquentfilter": "^3.2" + "illuminate/contracts": "^10.0 || ^11.0", + "illuminate/database": "^10.0 || ^11.0", + "spatie/laravel-package-tools": "^1.16", + "tucker-eric/eloquentfilter": "^3.3" }, "require-dev": { "ext-pdo": "*", - "nunomaduro/collision": "^7.0", - "nunomaduro/larastan": "^2.4.0", - "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", - "worksome/coding-style": "^2.5" + "nunomaduro/collision": "^7.10 || ^8.1", + "larastan/larastan": "^2.6", + "orchestra/testbench": "^8.21 || ^9.0", + "pestphp/pest": "^2.33", + "pestphp/pest-plugin-laravel": "^2.2", + "worksome/coding-style": "^2.8" }, "autoload": { "psr-4": { diff --git a/src/FilterQuery.php b/src/FilterQuery.php index 67d74c7..ef1bc10 100644 --- a/src/FilterQuery.php +++ b/src/FilterQuery.php @@ -44,7 +44,7 @@ public function __construct(Repository $config) } /** - * @param class-string $modelClass + * @param class-string $modelClass * * @return self */ @@ -57,7 +57,7 @@ public function model(string $modelClass): self } /** - * @param class-string $filterClass + * @param class-string $filterClass * * @return self */ @@ -73,7 +73,7 @@ public function apply(string $filterClass): self } /** - * @param array $input + * @param array $input * * @return self */ @@ -85,7 +85,7 @@ public function input(array $input = []): self } /** - * @param Builder $query + * @param Builder $query * * @return self */ @@ -119,7 +119,7 @@ public function get(): Collection } /** - * @param array $columns + * @param array $columns * * @return LengthAwarePaginator * @@ -140,7 +140,7 @@ public function paginateFilter( } /** - * @param array $columns + * @param array $columns * * @return Paginator * diff --git a/src/ModelFilter.php b/src/ModelFilter.php index 75220b5..c76afca 100644 --- a/src/ModelFilter.php +++ b/src/ModelFilter.php @@ -5,7 +5,6 @@ namespace Worksome\Filters; use EloquentFilter\ModelFilter as BaseModelFilter; -use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Str; /**