Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Test\Core\Providers;
- use Illuminate\Routing\Router;
- use Illuminate\Support\ServiceProvider;
- class CoreServiceProvider extends ServiceProvider
- {
- /**
- * Indicates if loading of the provider is deferred.
- *
- * @var bool
- */
- protected $defer = false;
- protected $providers = [
- 'Illuminate\Foundation\Providers\ArtisanServiceProvider::class',
- 'Bican\Roles\RolesServiceProvider::class',
- 'Maatwebsite\Sidebar\SidebarServiceProvider::class',
- 'Caffeinated\Modules\ModulesServiceProvider::class'
- ];
- protected $aliases = [
- 'Module' => Caffeinated\Modules\Facades\Module::class
- ];
- public function boot()
- {
- // include route.php file
- if (!$this->app->routesAreCached())
- include __DIR__.'/../Http/routes.php';
- }
- /**
- * Register the service provider.
- *
- * @return void
- */
- public function register()
- {
- foreach ( $this->aliases as $alias => $facade )
- {
- $this->app->alias( $alias, $facade );
- }
- }
- /**
- * Get the services provided by the provider.
- *
- * @return array
- */
- public function provides()
- {
- return $this->providers;
- }
- private function publishFiles()
- {
- // register config files
- $this->publishes([
- __DIR__.'/../Config/core.php' => config_path('core.php')
- ], 'test-core');
- // register views
- $this->loadViewsFrom(__DIR__.'/../Resources/views', 'test-core');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement