diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3ac07fa..f72d014 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,13 +14,11 @@ jobs: matrix: os: [ubuntu-latest] php: [8.2, 8.1] - laravel: [10.*] + laravel: [10.*, 11.*] stability: [prefer-lowest, prefer-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: @@ -44,7 +42,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 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 diff --git a/composer.json b/composer.json index 5deb758..c2a0e79 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ } ], "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" }, "require-dev": { "laravel/pint": "^1.0", - "orchestra/testbench": "^8.8", + "orchestra/testbench": "^8.8|^9.0", "spatie/laravel-ray": "^1.26" }, "autoload": {