*/ namespace Modules\MMFCustomersGroups\Providers; use Illuminate\Support\ServiceProvider; class MMFCustomersGroupsServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; /** * Boot the application events. * * @return void */ public function boot() { $this->registerConfig(); $this->registerViews(); $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); $this->hooks(); } /** * Register config. * * @return void */ protected function registerConfig() { $this->publishes([ __DIR__.'/../Config/config.php' => config_path('mmfcustomersgroups.php'), ], 'config'); $this->mergeConfigFrom( __DIR__.'/../Config/config.php', 'mmfcustomersgroups' ); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return []; } /** * Register views. * * @return void */ public function registerViews() { $viewPath = resource_path('views/modules/mmfcustomersgroups'); $sourcePath = __DIR__.'/../Resources/views'; $this->publishes([ $sourcePath => $viewPath, ],'views'); $this->loadViewsFrom(array_merge(array_map(function ($path) { return $path . '/modules/mmfcustomersgroups'; }, \Config::get('view.paths')), [$sourcePath]), 'mmfcustomersgroups'); } /** * Module hooks. */ public function hooks() { // Add a menu entry to manage the customer groups. \Eventy::addAction('menu.manage.after_mailboxes', function() { echo \View::make('mmfcustomersgroups::partials/menu', [])->render(); }); } }