loadViewsFrom(__DIR__ . '/../../resources/views', 'testimonial'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'testimonial'); // 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->registerFacade(); // $this->registerCommands(); $this->app->register(\Beo\Testimonial\Providers\AuthServiceProvider::class); $this->app->register(\Beo\Testimonial\Providers\RouteServiceProvider::class); // $this->app->register(\Beo\Testimonial\Providers\EventServiceProvider::class); // $this->app->register(\Beo\Testimonial\Providers\WorkflowServiceProvider::class); } /** * Register the vault facade without the user having to add it to the app.php file. * * @return void */ public function registerFacade() { $this->app->bind('beo.testimonial', function($app) { return $this->app->make(Testimonials::class); }); } /** * Merges user's and testimonial's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'beo.testimonial' ); $this->mergeConfigFrom( __DIR__ . '/../../config/testimonial.php', 'beo.testimonial.testimonial' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ \Beo\Testimonial\Commands\Testimonial::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['beo.testimonial']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('beo/testimonial')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/testimonial')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/testimonial')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }