From 01320a48e3ad0e89b064e4a2380c2735a92ab022 Mon Sep 17 00:00:00 2001 From: Subodh Dahal Date: Mon, 28 Aug 2017 19:01:15 +0545 Subject: [PATCH] Bugfix: Undefined property: Barryvdh\LaravelIdeHelper\Console\MetaCommand::$config (#562) --- src/Console/MetaCommand.php | 7 ++++++- src/IdeHelperServiceProvider.php | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Console/MetaCommand.php b/src/Console/MetaCommand.php index 9c623a6..13c9ed0 100644 --- a/src/Console/MetaCommand.php +++ b/src/Console/MetaCommand.php @@ -42,6 +42,9 @@ class MetaCommand extends Command /** @var \Illuminate\Contracts\View\Factory */ protected $view; + /** @var \Illuminate\Contracts\Config */ + protected $config; + protected $methods = [ 'new \Illuminate\Contracts\Container\Container', '\Illuminate\Contracts\Container\Container::make(0)', @@ -56,11 +59,13 @@ class MetaCommand extends Command * * @param \Illuminate\Contracts\Filesystem\Filesystem $files * @param \Illuminate\Contracts\View\Factory $view + * @param \Illuminate\Contracts\Config $config */ - public function __construct($files, $view) + public function __construct($files, $view, $config) { $this->files = $files; $this->view = $view; + $this->config = $config; parent::__construct(); } diff --git a/src/IdeHelperServiceProvider.php b/src/IdeHelperServiceProvider.php index 1305fb8..91a64cd 100644 --- a/src/IdeHelperServiceProvider.php +++ b/src/IdeHelperServiceProvider.php @@ -39,7 +39,7 @@ class IdeHelperServiceProvider extends ServiceProvider { $viewPath = __DIR__.'/../resources/views'; $this->loadViewsFrom($viewPath, 'ide-helper'); - + $configPath = __DIR__ . '/../config/ide-helper.php'; if (function_exists('config_path')) { $publishPath = config_path('ide-helper.php'); @@ -59,7 +59,7 @@ class IdeHelperServiceProvider extends ServiceProvider $configPath = __DIR__ . '/../config/ide-helper.php'; $this->mergeConfigFrom($configPath, 'ide-helper'); $localViewFactory = $this->createLocalViewFactory(); - + $this->app->singleton( 'command.ide-helper.generate', function ($app) use ($localViewFactory) { @@ -73,11 +73,11 @@ class IdeHelperServiceProvider extends ServiceProvider return new ModelsCommand($app['files']); } ); - + $this->app->singleton( 'command.ide-helper.meta', function ($app) use ($localViewFactory) { - return new MetaCommand($app['files'], $localViewFactory); + return new MetaCommand($app['files'], $localViewFactory, $app['config']); } );