loadViewsFrom(__DIR__ . '/../../resources/views', 'act'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'act'); // 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->registerAct(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerAct() { $this->app->bind('act', function($app) { return new Act($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('Act', 'Lavalite\Act\Facades\Act'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('annie.act', function ($app) { return $this->app->make('Annie\Act\Act'); }); // Bind Activity to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityRepository::class ); // Bind ActivityActivityArea to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityActivityAreaRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityActivityAreaRepository::class ); // Bind ActivityArea to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityAreaRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityAreaRepository::class ); // Bind ActivityCollege to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityCollegeRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityCollegeRepository::class ); // Bind ActivityCommunity to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityCommunityRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityCommunityRepository::class ); // Bind ActivityManager to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityManagerRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityManagerRepository::class ); // Bind ActivityMetum to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityMetumRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityMetumRepository::class ); // Bind ActivityProgramme to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityProgrammeRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityProgrammeRepository::class ); // Bind ActivityProject to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityProjectRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityProjectRepository::class ); // Bind ActivitySchool to repository $this->app->bind( 'Annie\Act\Interfaces\ActivitySchoolRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivitySchoolRepository::class ); // Bind ActivitySocialPartner to repository $this->app->bind( 'Annie\Act\Interfaces\ActivitySocialPartnerRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivitySocialPartnerRepository::class ); // Bind ActivityWorkArea to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityWorkAreaRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityWorkAreaRepository::class ); // Bind ActivityLog to repository $this->app->bind( 'Annie\Act\Interfaces\ActivityLogRepositoryInterface', \Annie\Act\Repositories\Eloquent\ActivityLogRepository::class ); $this->app->register(\Annie\Act\Providers\AuthServiceProvider::class); $this->app->register(\Annie\Act\Providers\EventServiceProvider::class); $this->app->register(\Annie\Act\Providers\RouteServiceProvider::class); $this->app->register(\Annie\Act\Providers\WorkflowServiceProvider::class); } /** * Merges user's and act's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/act.php', 'act' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeAct::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['annie.act']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('annie/act.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/act')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/act')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }