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..4bc2dd80 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,6 +45,7 @@ interface Repository * ($key is 'flasher.presets' ? array : * ($key is 'flasher.plugins' ? array : * ($key is 'flasher.flash_bag' ? array : + * ($key is 'flasher.excluded_paths' ? list : * mixed))))))) */ public function get(string|array $key, mixed $default = null): mixed;