Skip to content

Commit

Permalink
Merge pull request #4 from ARCANESOFT/dev
Browse files Browse the repository at this point in the history
Enhancements and refactoring
  • Loading branch information
arcanedev-maroc committed May 8, 2016
2 parents 745d139 + 1c02c1e commit 57350d5
Showing 1 changed file with 7 additions and 35 deletions.
42 changes: 7 additions & 35 deletions src/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AuthServiceProvider extends PackageServiceProvider
*
* @var string
*/
protected $package = 'auth';
protected $package = 'auth';

/* ------------------------------------------------------------------------------------------------
| Getters & Setters
Expand Down Expand Up @@ -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();
}

/**
Expand All @@ -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();
}
}

0 comments on commit 57350d5

Please sign in to comment.