loadViewsFrom(__DIR__ . '/../../resources/views', 'ing_vhiculo'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'ing_vhiculo'); // 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->registerIngVhiculo(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerIngVhiculo() { $this->app->bind('ing_vhiculo', function($app) { return new IngVhiculo($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('IngVhiculo', 'Lavalite\IngVhiculo\Facades\IngVhiculo'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('olger.ing_vhiculo', function ($app) { return $this->app->make('Olger\IngVhiculo\IngVhiculo'); }); // Bind Camabaja to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\CamabajaRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\CamabajaRepository::class ); // Bind Descuento to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\DescuentoRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\DescuentoRepository::class ); // Bind Tarifa to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\TarifaRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\TarifaRepository::class ); // Bind ClaseVehiculo to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\ClaseVehiculoRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\ClaseVehiculoRepository::class ); // Bind IngresoVehiculo to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\IngresoVehiculoRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\IngresoVehiculoRepository::class ); // Bind Foto to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\FotoRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\FotoRepository::class ); // Bind Factura to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\FacturaRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\FacturaRepository::class ); // Bind DetalleFacturas to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\DetalleFacturasRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\DetalleFacturasRepository::class ); // Bind InfoFacturas to repository $this->app->bind( 'Olger\IngVhiculo\Interfaces\InfoFacturasRepositoryInterface', \Olger\IngVhiculo\Repositories\Eloquent\InfoFacturasRepository::class ); $this->app->register(\Olger\IngVhiculo\Providers\AuthServiceProvider::class); $this->app->register(\Olger\IngVhiculo\Providers\RouteServiceProvider::class); } /** * Merges user's and ing_vhiculo's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/ing_vhiculo.php', 'ing_vhiculo' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeIngVhiculo::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['olger.ing_vhiculo']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('olger/ing_vhiculo.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/ing_vhiculo')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/ing_vhiculo')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }