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