From 0b0c9e4d6a6b5178c96ffef3fbe06fd229017c2b Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 13:28:21 -0400 Subject: [PATCH 01/10] Support Laravel 11 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5deb758..f6c4c21 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ } ], "require": { - "php": "^8.1", - "illuminate/contracts": "^10.0", + "php": ">=8.1", + "illuminate/contracts": "^10.0|^11.0", "predis/predis": "^2.2", "spatie/laravel-package-tools": "^1.14.0" }, From 083a2891c0b85ef8e3d1f46d351c17275a207903 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 14:13:21 -0400 Subject: [PATCH 02/10] Add 11 tests --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3ac07fa..729a4bd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [ubuntu-latest] php: [8.2, 8.1] - laravel: [10.*] + laravel: [10.*, 11.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* From 436f11e1b301d8963d71cf2c9940013ffe73a525 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 14:29:21 -0400 Subject: [PATCH 03/10] Actions --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 729a4bd..4405a89 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -44,7 +44,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List Installed Dependencies From e6bfefa01d4882433d3108fbdfbcb540d3efc50a Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 14:37:07 -0400 Subject: [PATCH 04/10] WIP --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4405a89..b7974ee 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest] php: [8.2, 8.1] laravel: [10.*, 11.*] - stability: [prefer-lowest, prefer-stable] + stability: [lowest, stable] include: - laravel: 10.* testbench: 8.* From 2ce08686510ebc71e66cb256e87403cba27d4ede Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 14:47:36 -0400 Subject: [PATCH 05/10] WIP --- .github/workflows/run-tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b7974ee..536141d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -16,11 +16,9 @@ jobs: php: [8.2, 8.1] laravel: [10.*, 11.*] stability: [lowest, stable] - include: - - laravel: 10.* - testbench: 8.* - carbon: ^2.63 - + exclude: + - php: 8.1 + laravel: 11.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: From 358672e7e4c91daa16eb4571fbfd0855cb1f8ea5 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 15:13:46 -0400 Subject: [PATCH 06/10] WIP --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 536141d..f72d014 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest] php: [8.2, 8.1] laravel: [10.*, 11.*] - stability: [lowest, stable] + stability: [prefer-lowest, prefer-stable] exclude: - php: 8.1 laravel: 11.* From 1e7e3eace6a299154287ada2ab8156fc9a08e034 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Wed, 17 Apr 2024 15:16:27 -0400 Subject: [PATCH 07/10] WIP --- .github/workflows/run-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f72d014..453ef8a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,6 +19,7 @@ jobs: exclude: - php: 8.1 laravel: 11.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: From 9ba7ba9ce2bcd3f5ece217577b5a0cfca3809bb0 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Mon, 22 Apr 2024 10:43:48 -0400 Subject: [PATCH 08/10] WIP --- .github/workflows/run-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 453ef8a..f72d014 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,6 @@ jobs: exclude: - php: 8.1 laravel: 11.* - testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: From fbfed778703641677c973f361e544594ed6d0f67 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Mon, 22 Apr 2024 10:46:57 -0400 Subject: [PATCH 09/10] WIP --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f6c4c21..c2a0e79 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ }, "require-dev": { "laravel/pint": "^1.0", - "orchestra/testbench": "^8.8", + "orchestra/testbench": "^8.8|^9.0", "spatie/laravel-ray": "^1.26" }, "autoload": { From 36881dd3fbda345d06d97e084f248d027a2fc3e1 Mon Sep 17 00:00:00 2001 From: Daniel Coulbourne Date: Mon, 13 May 2024 13:15:09 -0400 Subject: [PATCH 10/10] Update Middleware docs --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 25437ca..34c6270 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,23 @@ Add the `Wafris\AllowRequestMiddleware` middleware to routes that you want to ha ### Protecting all routes +To protect all routes in your Laravel application, add the `Wafris\AllowRequestMiddleware` globally. + +#### Laravel 11 + +[Starting in Laravel 11](https://laravel.com/docs/11.x/middleware#global-middleware), middleware are registered in `bootstrap/app.php`. Add the following line in the `withMiddleware` section of that file: + +```php +Application::configure(basePath: dirname(__DIR__)) + // ... + ->withMiddleware(function (Middleware $middleware) { + // ... other middleware + $middleware->append(\Wafris\AllowRequestMiddleware::class); + }); +``` + +### Laravel 10 + To protect all routes in your Laravel application, add `Wafris\AllowRequestMiddleware` to the `$middleware` property of your `app/Http/Kernel.php` class. ```php