Skip to content

Commit 5ed8aa2

Browse files
committed
fix command
1 parent 35da9fd commit 5ed8aa2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/Commands/GenerateModuleCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function handle()
4646
$this->warn("Path for creating =>". config_path());
4747
die();
4848
}
49+
50+
$this->callSilent('vendor:publish', ['--tag' => 'config' ,'--force' => true]);
51+
4952
$processes = count(\config()->get('modulegenerator') , COUNT_RECURSIVE);
5053
$Progress = $this->getOutput()->createProgressBar($processes);
5154
$Progress->setBarCharacter("/");

src/Provider/GeneratorServiceProvider.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Shetabit\ModuleGenerator\Provider;
44

55
use Illuminate\Support\ServiceProvider;
6+
use Shetabit\ModuleGenerator\Commands\GenerateModuleCommand;
67
use Shetabit\ModuleGenerator\Contracts\ControllerGenerator;
78
use Shetabit\ModuleGenerator\Contracts\ForeignKeyGenerator;
89
use Shetabit\ModuleGenerator\Contracts\MigrationGenerator;
@@ -40,11 +41,17 @@ public function register()
4041

4142
public function boot()
4243
{
44+
if ($this->app->runningInConsole()) {
45+
$this->commands([
46+
GenerateModuleCommand::class,
47+
]);
48+
}
49+
4350
$this->publishes([
4451
__DIR__.'/../Config/modulegenerator.php' => config_path('modulegenerator.php'),
45-
]);
46-
$this->publishes([
4752
__DIR__.'/../Config/moduleConfig.php' => config_path('moduleConfig.php'),
48-
]);
53+
54+
],'config');
55+
4956
}
5057
}

0 commit comments

Comments
 (0)