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