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