mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Merge pull request #197 from php-flasher/issues/190
refactor: FlasherServiceProvider Update HttpKernel import and reorder methods
This commit is contained in:
@@ -35,9 +35,9 @@ use Flasher\Prime\Storage\Storage;
|
||||
use Flasher\Prime\Storage\StorageManager;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Contracts\Http\Kernel as HttpKernel;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Console\AboutCommand;
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
use Illuminate\View\Compilers\BladeCompiler;
|
||||
use Laravel\Octane\Events\RequestReceived;
|
||||
use Livewire\LivewireManager;
|
||||
@@ -236,23 +236,6 @@ final class FlasherServiceProvider extends PluginServiceProvider
|
||||
$this->pushMiddlewareToGroup(FlasherMiddleware::class);
|
||||
}
|
||||
|
||||
private function registerCspHandler(): void
|
||||
{
|
||||
$this->app->singleton('flasher.csp_handler', static function () {
|
||||
return new ContentSecurityPolicyHandler(new NonceGenerator());
|
||||
});
|
||||
}
|
||||
|
||||
private function registerAssetManager(): void
|
||||
{
|
||||
$this->app->singleton('flasher.asset_manager', static function () {
|
||||
$publicDir = public_path('/');
|
||||
$manifestPath = public_path('vendor'.\DIRECTORY_SEPARATOR.'flasher'.\DIRECTORY_SEPARATOR.'manifest.json');
|
||||
|
||||
return new AssetManager($publicDir, $manifestPath);
|
||||
});
|
||||
}
|
||||
|
||||
private function registerSessionMiddleware(): void
|
||||
{
|
||||
if (!$this->getConfig('flash_bag')) {
|
||||
@@ -278,6 +261,23 @@ final class FlasherServiceProvider extends PluginServiceProvider
|
||||
});
|
||||
}
|
||||
|
||||
private function registerCspHandler(): void
|
||||
{
|
||||
$this->app->singleton('flasher.csp_handler', static function () {
|
||||
return new ContentSecurityPolicyHandler(new NonceGenerator());
|
||||
});
|
||||
}
|
||||
|
||||
private function registerAssetManager(): void
|
||||
{
|
||||
$this->app->singleton('flasher.asset_manager', static function () {
|
||||
$publicDir = public_path('/');
|
||||
$manifestPath = public_path('vendor'.\DIRECTORY_SEPARATOR.'flasher'.\DIRECTORY_SEPARATOR.'manifest.json');
|
||||
|
||||
return new AssetManager($publicDir, $manifestPath);
|
||||
});
|
||||
}
|
||||
|
||||
private function registerBladeDirectives(BladeCompiler $blade): void
|
||||
{
|
||||
$blade->directive('flasher_render', function (string $expression = '') {
|
||||
|
||||
Reference in New Issue
Block a user