diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a59846e..41f22399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # CHANGELOG for 2.x -## [Unreleased](https://github.com/php-flasher/php-flasher/compare/v2.1.0...2.x) +## [Unreleased](https://github.com/php-flasher/php-flasher/compare/v2.1.1...2.x) + +## [v2.1.1](https://github.com/php-flasher/php-flasher/compare/v2.1.0...v2.1.1) - 2024-10-20 + +* feature [Laravel] Add `excluded_paths` option. See [PR #203](https://github.com/php-flasher/php-flasher/pull/203) by [yoeunes](https://github.com/yoeunes) ## [v2.1.0](https://github.com/php-flasher/php-flasher/compare/v2.0.4...v2.1.0) - 2024-10-19 diff --git a/package-lock.json b/package-lock.json index 24040d9f..31aca6f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1967,7 +1967,7 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { diff --git a/src/Laravel/FlasherServiceProvider.php b/src/Laravel/FlasherServiceProvider.php index e55dc732..3e23a54a 100644 --- a/src/Laravel/FlasherServiceProvider.php +++ b/src/Laravel/FlasherServiceProvider.php @@ -227,10 +227,13 @@ final class FlasherServiceProvider extends PluginServiceProvider } $this->app->singleton(FlasherMiddleware::class, static function (Application $app) { + $config = $app->make('config'); + $flasher = $app->make('flasher'); $cspHandler = $app->make('flasher.csp_handler'); + $excludedPaths = $config->get('flasher.excluded_paths', []) ?: []; - return new FlasherMiddleware(new ResponseExtension($flasher, $cspHandler)); + return new FlasherMiddleware(new ResponseExtension($flasher, $cspHandler, $excludedPaths)); }); $this->pushMiddlewareToGroup(FlasherMiddleware::class); diff --git a/src/Laravel/Phpstan/stubs/Repository.stub b/src/Laravel/Phpstan/stubs/Repository.stub index 72c24482..43d7eb7c 100644 --- a/src/Laravel/Phpstan/stubs/Repository.stub +++ b/src/Laravel/Phpstan/stubs/Repository.stub @@ -13,6 +13,7 @@ namespace Illuminate\Contracts\Config; * scripts: string[], * styles: string[], * options: array, + * excluded_paths?: list, * filter: array, * flash_bag: array, * presets: array, @@ -44,7 +45,8 @@ interface Repository * ($key is 'flasher.presets' ? array : * ($key is 'flasher.plugins' ? array : * ($key is 'flasher.flash_bag' ? array : - * mixed))))))) + * ($key is 'flasher.excluded_paths' ? list : + * mixed)))))))) */ public function get(string|array $key, mixed $default = null): mixed; }