From b8b93ecb7e423751ec12ef08548e5ff59b2c5de2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 3 Dec 2020 14:22:07 +0100 Subject: [PATCH] wip #3753 --- src/GtagFrontProvider.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/GtagFrontProvider.php b/src/GtagFrontProvider.php index dceb346..76c0271 100644 --- a/src/GtagFrontProvider.php +++ b/src/GtagFrontProvider.php @@ -5,7 +5,7 @@ namespace Cubist\Gtag; use Illuminate\Support\ServiceProvider; -class GtagServiceProvider extends ServiceProvider +class GtagFrontProvider extends ServiceProvider { /** * Perform post-registration booting of services. @@ -14,14 +14,16 @@ class GtagServiceProvider extends ServiceProvider */ public function boot() { - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'gtag'); + $resourcesDir= dirname(__DIR__) . '/resources'; + + $this->loadViewsFrom($resourcesDir . '/views', 'gtag'); $this->publishes([ - __DIR__ . '/../resources/config/config.php' => config_path('gtag.php'), + $resourcesDir . '/config/config.php' => config_path('gtag.php'), ], 'config'); $this->publishes([ - __DIR__ . '/../resources/views' => base_path('resources/views/vendor/cubist/gtag'), + $resourcesDir . '/views' => base_path('resources/views/vendor/cubist/gtag'), ], 'views'); $this->app['view']->creator( @@ -35,7 +37,9 @@ class GtagServiceProvider extends ServiceProvider */ public function register() { - $this->mergeConfigFrom(__DIR__ . '/../resources/config/config.php', 'gtag'); + $resourcesDir= dirname(__DIR__) . '/resources'; + + $this->mergeConfigFrom($resourcesDir . '/config/config.php', 'gtag'); $googleAnalytics = new GoogleAnalytics(config('gtag.id')); -- 2.39.5