loadViewsFrom(__DIR__ . '/../../resources/views', 'account'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'account'); // 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\Account\Providers\AuthServiceProvider::class); $this->app->register(\Bixo\Account\Providers\RouteServiceProvider::class); $this->app->register(\Bixo\Account\Providers\ActionServiceProvider::class); $this->app->register(\Bixo\Account\Providers\EventServiceProvider::class); $this->app->register(\Bixo\Account\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.account', function($app) { return $this->app->make(Account::class); }); } /** * Merges user's and account's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'bixo.account' ); $this->mergeConfigFrom( __DIR__ . '/../../config/invoice.php', 'bixo.account.invoice' ); $this->mergeConfigFrom( __DIR__ . '/../../config/coa.php', 'bixo.account.coa' ); $this->mergeConfigFrom( __DIR__ . '/../../config/payrec.php', 'bixo.account.payrec' ); $this->mergeConfigFrom( __DIR__ . '/../../config/payrec_detail.php', 'bixo.account.payrec_detail' ); $this->mergeConfigFrom( __DIR__ . '/../../config/payrec_receipts.php', 'bixo.account.payrec_receipts' ); $this->mergeConfigFrom( __DIR__ . '/../../config/invoice_detail.php', 'bixo.account.invoice_detail' ); $this->mergeConfigFrom( __DIR__ . '/../../config/product.php', 'bixo.account.product' ); $this->mergeConfigFrom( __DIR__ . '/../../config/costcenter.php', 'bixo.account.costcenter' ); $this->mergeConfigFrom( __DIR__ . '/../../config/account.php', 'bixo.account.account' ); $this->mergeConfigFrom( __DIR__ . '/../../config/drcrnote.php', 'bixo.account.drcrnote' ); $this->mergeConfigFrom( __DIR__ . '/../../config/drcrnote_detail.php', 'bixo.account.drcrnote_detail' ); $this->mergeConfigFrom( __DIR__ . '/../../config/bank.php', 'bixo.account.bank' ); $this->mergeConfigFrom( __DIR__ . '/../../config/customer.php', 'bixo.account.customer' ); $this->mergeConfigFrom( __DIR__ . '/../../config/acknowledgement.php', 'bixo.account.acknowledgement' ); $this->mergeConfigFrom( __DIR__ . '/../../config/acknowledgement_detail.php', 'bixo.account.acknowledgement_detail' ); $this->mergeConfigFrom( __DIR__ . '/../../config/allocation.php', 'bixo.account.allocation' ); $this->mergeConfigFrom( __DIR__ . '/../../config/journal.php', 'bixo.account.journal' ); $this->mergeConfigFrom( __DIR__ . '/../../config/detail.php', 'bixo.account.detail' ); $this->mergeConfigFrom( __DIR__ . '/../../config/ledger.php', 'bixo.account.ledger' ); $this->mergeConfigFrom( __DIR__ . '/../../config/transaction.php', 'bixo.account.transaction' ); $this->mergeConfigFrom( __DIR__ . '/../../config/transactions_detail.php', 'bixo.account.transactions_detail' ); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['bixo.account']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('bixo/account')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/account')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/account')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }