From 44682c2ff71caf8b794fb181473f570af9c31c90 Mon Sep 17 00:00:00 2001 From: Oussama Date: Sat, 30 Mar 2024 22:03:20 +0100 Subject: [PATCH] Laravel 11 Support (#9) Add Laravel `11.x` support --- .github/workflows/run-tests.yml | 10 ++++++++-- composer.json | 9 ++++----- src/LaravelTurnstile.php | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b5d6720..981e7af 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,13 +13,19 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.2, 8.1] - laravel: [10.*] + php: [8.1, 8.2, 8.3] + laravel: [10.*, 11.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* testbench: 8.* carbon: ^2.63 + - laravel: 11.* + testbench: 9.* + carbon: '*' + 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 be957e5..dcfabf1 100644 --- a/composer.json +++ b/composer.json @@ -18,19 +18,18 @@ } ], "require": { - "php": "^8.1", + "php": "^8.1|^8.2", "guzzlehttp/guzzle": "^7.7", - "illuminate/contracts": "^10.0", + "illuminate/contracts": "^10.0|^11.0", "spatie/laravel-package-tools": "^1.14.0" }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.9", + "nunomaduro/collision": "^7.0|^8.0", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^8.0", + "orchestra/testbench": "^8.0|^9.0", "pestphp/pest": "^2.0", "pestphp/pest-plugin-arch": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0" diff --git a/src/LaravelTurnstile.php b/src/LaravelTurnstile.php index 139084d..075b96d 100755 --- a/src/LaravelTurnstile.php +++ b/src/LaravelTurnstile.php @@ -10,7 +10,7 @@ class LaravelTurnstile { protected ?string $url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify'; - public function validate(string $cfResponse = null): array + public function validate(?string $cfResponse = null): array { $turnstileResponse = is_null($cfResponse) ? request()->get('cf-turnstile-response')