loadViewsFrom(__DIR__ . '/../../resources/views', 'logbook'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'logbook'); // Load migrations $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); // Call pblish redources function $this->publishResources(); } /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfig(); $this->registerLogbook(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerLogbook() { $this->app->bind('logbook', function($app) { return new Logbook($app); }); } /** * Register the vault facade without the user having to add it to the app.php file. * * @return void */ public function registerFacade() { $this->app->booting(function() { $loader = \Illuminate\Foundation\AliasLoader::getInstance(); $loader->alias('Logbook', 'Lavalite\Logbook\Facades\Logbook'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('moblyze.logbook', function ($app) { return $this->app->make('Moblyze\Logbook\Logbook'); }); // Bind PassengerManifest to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\PassengerManifestRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\PassengerManifestRepository::class ); // Bind LogbookMaster to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\LogbookMasterRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\LogbookMasterRepository::class ); // Bind AssetLogbook to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\AssetLogbookRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\AssetLogbookRepository::class ); // Bind SafetyBriefing to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\SafetyBriefingRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\SafetyBriefingRepository::class ); // Bind VesselLogbook to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\VesselLogbookRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\VesselLogbookRepository::class ); // Bind VesselRunningSheet to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\VesselRunningSheetRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\VesselRunningSheetRepository::class ); // Bind IameDetail to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\IameDetailRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\IameDetailRepository::class ); // Bind EmergencyDrill to repository $this->app->bind( 'Moblyze\Logbook\Interfaces\EmergencyDrillRepositoryInterface', \Moblyze\Logbook\Repositories\Eloquent\EmergencyDrillRepository::class ); $this->app->register(\Moblyze\Logbook\Providers\AuthServiceProvider::class); $this->app->register(\Moblyze\Logbook\Providers\RouteServiceProvider::class); } /** * Merges user's and logbook's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'moblyze.logbook' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeLogbook::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['moblyze.logbook']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('moblyze/logbook.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/logbook')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/logbook')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }