mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Merge pull request #203 from php-flasher/laravel-excluded-paths
chore: add Laravel excluded paths option
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
|
||||
Generated
+1
-1
@@ -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": {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Illuminate\Contracts\Config;
|
||||
* scripts: string[],
|
||||
* styles: string[],
|
||||
* options: array<string, mixed>,
|
||||
* excluded_paths?: list<non-empty-string>,
|
||||
* filter: array<string, mixed>,
|
||||
* flash_bag: array<string, string[]>,
|
||||
* presets: array<string, PresetType>,
|
||||
@@ -44,7 +45,8 @@ interface Repository
|
||||
* ($key is 'flasher.presets' ? array<string, PresetType> :
|
||||
* ($key is 'flasher.plugins' ? array<string, PluginType> :
|
||||
* ($key is 'flasher.flash_bag' ? array<string, string[]> :
|
||||
* mixed)))))))
|
||||
* ($key is 'flasher.excluded_paths' ? list<non-empty-string> :
|
||||
* mixed))))))))
|
||||
*/
|
||||
public function get(string|array $key, mixed $default = null): mixed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user