summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--resources/views/components/footer.blade.php1
-rw-r--r--resources/views/components/head.blade.php1
-rw-r--r--src/AssetsServiceProvider.php16
3 files changed, 18 insertions, 0 deletions
diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php
new file mode 100644
index 0000000..7cfc4fc
--- /dev/null
+++ b/resources/views/components/footer.blade.php
@@ -0,0 +1 @@
+@inject('assets', 'Lightscale\LaralightAssets\Assets')
diff --git a/resources/views/components/head.blade.php b/resources/views/components/head.blade.php
new file mode 100644
index 0000000..7cfc4fc
--- /dev/null
+++ b/resources/views/components/head.blade.php
@@ -0,0 +1 @@
+@inject('assets', 'Lightscale\LaralightAssets\Assets')
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}"),
+ ]);
+ }
+
}