diff --git a/src/LaravelServiceProvider.php b/src/LaravelServiceProvider.php index ea0b5b5691..b20c78741d 100644 --- a/src/LaravelServiceProvider.php +++ b/src/LaravelServiceProvider.php @@ -20,6 +20,7 @@ public function boot() { $this->publishes([__DIR__ . '/../config/config.php' => config_path('lighthouse.php')]); $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'lighthouse'); + $this->loadViewsFrom(realpath(__DIR__.'/Support/Console/Commands/stubs'), 'lighthouse'); if (config('lighthouse.controller')) { require_once __DIR__.'/Support/Http/routes.php'; diff --git a/src/Support/Console/Commands/TypeMakeCommand.php b/src/Support/Console/Commands/TypeMakeCommand.php index 833045d1a0..84b2bb1658 100644 --- a/src/Support/Console/Commands/TypeMakeCommand.php +++ b/src/Support/Console/Commands/TypeMakeCommand.php @@ -64,7 +64,6 @@ protected function getDefaultNamespace($rootNamespace) protected function buildClass($name) { if ($model = $this->option('model')) { - $this->setViewPath(); $stub = $this->getEloquentStub($model); } else { $stub = $this->files->get($this->getStub()); @@ -86,19 +85,6 @@ protected function getOptions() ]; } - /** - * Set config view paths. - * - * @return void - */ - protected function setViewPath() - { - $paths = config('view.paths'); - $paths[] = realpath(__DIR__.'/stubs'); - - config(['view.paths' => $paths]); - } - /** * Generate stub from eloquent type. * @@ -118,7 +104,7 @@ protected function getEloquentStub($model) $fields = $this->getTypeFields($model); - return "render(); + return "render(); } /**