From a56a167ac5e5384810a980f97e71b182ce7a98a2 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Mon, 31 Mar 2025 01:08:16 +0100 Subject: Setup components to output assets --- src/AssetsServiceProvider.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/AssetsServiceProvider.php b/src/AssetsServiceProvider.php index ba97e21..9e1d40d 100644 --- a/src/AssetsServiceProvider.php +++ b/src/AssetsServiceProvider.php @@ -6,7 +6,23 @@ use Illuminate\Support\ServiceProvider; class AssetsServiceProvider extends ServiceProvider { + public const NAMESPACE = 'laralight-assets'; + public $singletons = [ Assets::class ]; + + public function boot(): void + { + $ns = static::NAMESPACE; + $root = __DIR__ . '/../'; + $viewsPath = $root . 'resources/views'; + + $this->loadViewsFrom($viewsPath, $ns); + + $this->publishes([ + $viewsPath => resource_path("views/vendor/{$ns}"), + ]); + } + } -- cgit v1.2.3