From 677f7212569e6f86898de990f60e56ff038be9cb Mon Sep 17 00:00:00 2001 From: Akki Khare Date: Tue, 15 Feb 2022 23:30:27 -0500 Subject: [PATCH] facade to clear resolve instance to avoid duplication --- src/Facades/LaravelGoogleAnalytics.php | 4 +++- src/LaravelGoogleAnalyticsServiceProvider.php | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Facades/LaravelGoogleAnalytics.php b/src/Facades/LaravelGoogleAnalytics.php index c1ddf74c..c51234e5 100644 --- a/src/Facades/LaravelGoogleAnalytics.php +++ b/src/Facades/LaravelGoogleAnalytics.php @@ -77,6 +77,8 @@ class LaravelGoogleAnalytics extends Facade */ protected static function getFacadeAccessor(): string { - return 'laravel-google-analytics'; + self::clearResolvedInstance(\AkkiIo\LaravelGoogleAnalytics\LaravelGoogleAnalytics::class); + + return \AkkiIo\LaravelGoogleAnalytics\LaravelGoogleAnalytics::class; } } diff --git a/src/LaravelGoogleAnalyticsServiceProvider.php b/src/LaravelGoogleAnalyticsServiceProvider.php index d66a11e6..25ed6b5d 100644 --- a/src/LaravelGoogleAnalyticsServiceProvider.php +++ b/src/LaravelGoogleAnalyticsServiceProvider.php @@ -25,10 +25,5 @@ public function register() { // Automatically apply the package configuration $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'laravel-google-analytics'); - - // Register the main class to use with the facade - $this->app->singleton('laravel-google-analytics', function () { - return new LaravelGoogleAnalytics; - }); } }