loadViewsFrom(__DIR__ . '/../../resources/views', 'appointmant'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'appointmant'); // 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->registerAppointmant(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerAppointmant() { $this->app->bind('appointmant', function($app) { return new Appointmant($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('Appointmant', 'Lavalite\Appointmant\Facades\Appointmant'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('laravel.appointmant', function ($app) { return $this->app->make('Laravel\Appointmant\Appointmant'); }); // Bind Appointments to repository $this->app->bind( 'Laravel\Appointmant\Interfaces\AppointmentsRepositoryInterface', \Laravel\Appointmant\Repositories\Eloquent\AppointmentsRepository::class ); $this->app->register(\Laravel\Appointmant\Providers\AuthServiceProvider::class); $this->app->register(\Laravel\Appointmant\Providers\RouteServiceProvider::class); } /** * Merges user's and appointmant's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'laravel.appointmant' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeAppointmant::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['laravel.appointmant']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('laravel/appointmant.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/appointmant')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/appointmant')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }