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