From 1c02c1e2fc35662596c2859d97425ef1bae74cf4 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Fri, 6 May 2016 21:21:03 +0100 Subject: [PATCH] Refactoring the AuthServiceProvider --- src/AuthServiceProvider.php | 42 +++++++------------------------------ 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/src/AuthServiceProvider.php b/src/AuthServiceProvider.php index 69dc526..943ab68 100644 --- a/src/AuthServiceProvider.php +++ b/src/AuthServiceProvider.php @@ -20,7 +20,7 @@ class AuthServiceProvider extends PackageServiceProvider * * @var string */ - protected $package = 'auth'; + protected $package = 'auth'; /* ------------------------------------------------------------------------------------------------ | Getters & Setters @@ -62,10 +62,14 @@ public function register() */ public function boot() { - $this->registerPublishes(); - $this->app->register(Providers\RouteServiceProvider::class); $this->app->register(Providers\ValidatorServiceProvider::class); + + // Publishes + $this->publishConfig(); + $this->publishViews(); + $this->publishTranslations(); + $this->publishSidebarItems(); } /** @@ -79,36 +83,4 @@ public function provides() // ]; } - - /* ------------------------------------------------------------------------------------------------ - | Other Functions - | ------------------------------------------------------------------------------------------------ - */ - /** - * Register publishes. - */ - private function registerPublishes() - { - // Config - $this->publishes([ - $this->getConfigFile() => config_path("{$this->vendor}/{$this->package}.php"), - ], 'config'); - - // Views - $viewsPath = $this->getBasePath() . '/resources/views'; - $this->loadViewsFrom($viewsPath, 'auth'); - $this->publishes([ - $viewsPath => base_path('resources/views/vendor/auth'), - ], 'views'); - - // Translations - $translationsPath = $this->getBasePath() . '/resources/lang'; - $this->loadTranslationsFrom($translationsPath, 'auth'); - $this->publishes([ - $translationsPath => base_path('resources/lang/vendor/auth'), - ], 'lang'); - - // Sidebar items - $this->publishSidebarItems(); - } }