loadViewsFrom(__DIR__ . '/../../resources/views', 'evnt'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'evnt'); // 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->registerEvnt(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerEvnt() { $this->app->bind('evnt', function($app) { return new Evnt($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('Evnt', 'Lavalite\Evnt\Facades\Evnt'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('annie.evnt', function ($app) { return $this->app->make('Annie\Evnt\Evnt'); }); // Bind Event to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventRepository::class ); // Bind EventComment to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventCommentRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventCommentRepository::class ); // Bind EventCommunity to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventCommunityRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventCommunityRepository::class ); // Bind EventInvitation to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventInvitationRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventInvitationRepository::class ); // Bind EventLike to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventLikeRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventLikeRepository::class ); // Bind EventManager to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventManagerRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventManagerRepository::class ); // Bind EventSchool to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventSchoolRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventSchoolRepository::class ); // Bind EventProject to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventProjectRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventProjectRepository::class ); // Bind EventSetting to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventSettingRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventSettingRepository::class ); // Bind EventSocialPartner to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventSocialPartnerRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventSocialPartnerRepository::class ); // Bind EventCollege to repository $this->app->bind( 'Annie\Evnt\Interfaces\EventCollegeRepositoryInterface', \Annie\Evnt\Repositories\Eloquent\EventCollegeRepository::class ); $this->app->register(\Annie\Evnt\Providers\AuthServiceProvider::class); $this->app->register(\Annie\Evnt\Providers\RouteServiceProvider::class); } /** * Merges user's and evnt's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/evnt.php', 'evnt' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeEvnt::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['annie.evnt']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('annie/evnt.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/evnt')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/evnt')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }