loadViewsFrom(__DIR__ . '/../../resources/views', 'payment'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'payment'); // 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->app->register(\Bixo\Payment\Providers\AuthServiceProvider::class); $this->app->register(\Bixo\Payment\Providers\RouteServiceProvider::class); $this->app->register(\Bixo\Payment\Providers\ActionServiceProvider::class); $this->app->register(\Bixo\Payment\Providers\EventServiceProvider::class); $this->app->register(\Bixo\Payment\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('bixo.payment', function($app) { return $this->app->make(Payment::class); }); } /** * Merges user's and payment's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'bixo.payment' ); $this->mergeConfigFrom( __DIR__ . '/../../config/detail.php', 'bixo.payment.detail' ); $this->mergeConfigFrom( __DIR__ . '/../../config/refund.php', 'bixo.payment.refund' ); $this->mergeConfigFrom( __DIR__ . '/../../config/invoice.php', 'bixo.payment.invoice' ); $this->mergeConfigFrom( __DIR__ . '/../../config/gateway.php', 'bixo.payment.gateway' ); $this->mergeConfigFrom( __DIR__ . '/../../config/payment.php', 'bixo.payment.payment' ); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['bixo.payment']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('bixo/payment')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/payment')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/payment')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }