From 78a521f7d6cd9f1f94ef7fe6d780577d6cca1c78 Mon Sep 17 00:00:00 2001 From: Choraimy Kroonstuiver <3661474+axlon@users.noreply.github.com> Date: Thu, 1 Sep 2022 22:11:43 +0200 Subject: [PATCH] Lazily register blade directives (#104) --- src/CspServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CspServiceProvider.php b/src/CspServiceProvider.php index 351fa62..8b5935a 100644 --- a/src/CspServiceProvider.php +++ b/src/CspServiceProvider.php @@ -23,7 +23,9 @@ public function packageBooted() return app(NonceGenerator::class)->generate(); }); - $this->registerBladeDirectives(); + $this->callAfterResolving('view', function () { + $this->registerBladeDirectives(); + }); } private function registerBladeDirectives(): void