From f525ad7b8b621b8b7803ef54d6d7756b48273ce8 Mon Sep 17 00:00:00 2001 From: Laravel Shift Date: Mon, 4 Mar 2024 07:22:56 -0500 Subject: [PATCH] Laravel 11.x Compatibility (#12) * Bump dependencies for Laravel 11 * Update GitHub Actions for Laravel 11 * Fix Carbon diffIn* --------- Co-authored-by: David Torras --- .github/workflows/run-tests.yml | 14 +++++++++++--- composer.json | 14 +++++++------- src/Commands/LaravelWebMailerCleanUpCommand.php | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e318cf0..c7d453a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,25 +2,33 @@ name: run-tests on: push: - branches: [main] + branches: + - main pull_request: - branches: [main] + branches: + - main jobs: test: runs-on: ${{ matrix.os }} + strategy: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] php: [8.2, 8.1] - laravel: [10.*, 9.*] + laravel: ['9.*', '10.*', '11.*'] stability: [prefer-stable] include: - laravel: 9.* testbench: 7.* - laravel: 10.* testbench: 8.* + - laravel: 11.* + testbench: 9.* + exclude: + - laravel: 11.* + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 80ac5dc..1bfc99e 100644 --- a/composer.json +++ b/composer.json @@ -19,20 +19,20 @@ "require": { "php": "^8.1", "spatie/laravel-package-tools": "^1.9.2", - "illuminate/contracts": "^9.0|^10.0", - "symfony/mime":"^6.1" + "illuminate/contracts": "^9.0|^10.0|^11.0", + "symfony/mime": "^6.1|^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.8", - "nunomaduro/collision": "^6.0", + "nunomaduro/collision": "^6.0|^8.0", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0|^8.0", - "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", + "orchestra/testbench": "^7.0|^8.0|^9.0", + "pestphp/pest": "^1.21|^2.34", + "pestphp/pest-plugin-laravel": "^1.1|^2.3", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5|^10.5" }, "autoload": { "psr-4": { diff --git a/src/Commands/LaravelWebMailerCleanUpCommand.php b/src/Commands/LaravelWebMailerCleanUpCommand.php index 3a1bf04..29f2030 100644 --- a/src/Commands/LaravelWebMailerCleanUpCommand.php +++ b/src/Commands/LaravelWebMailerCleanUpCommand.php @@ -23,7 +23,7 @@ public function handle(LaravelWebMailRepository $laravelWebMailRepository): int $laravelWebMailRepository ->all() ->filter( - fn (LaravelWebMailDto $laravelWebMailDto) => $currentTime->diffInDays($laravelWebMailDto->sentAt) > $numberOfDays + fn (LaravelWebMailDto $laravelWebMailDto) => $laravelWebMailDto->sentAt->diffInDays($currentTime) > $numberOfDays ) ->each(fn (LaravelWebMailDto $laravelWebMailDto) => $laravelWebMailRepository->delete($laravelWebMailDto->messageId));