| @@ 6-36 (lines=31) @@ | ||
| 3 | use Illuminate\Console\Command; |
|
| 4 | use Modules\Core\Console\Installers\SetupScript; |
|
| 5 | ||
| 6 | class ModuleAssets implements SetupScript |
|
| 7 | { |
|
| 8 | /** |
|
| 9 | * @var array |
|
| 10 | */ |
|
| 11 | protected $modules = [ |
|
| 12 | 'Core', |
|
| 13 | 'Media', |
|
| 14 | 'Menu', |
|
| 15 | ]; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Fire the install script |
|
| 19 | * @param Command $command |
|
| 20 | * @return mixed |
|
| 21 | */ |
|
| 22 | public function fire(Command $command) |
|
| 23 | { |
|
| 24 | if ($command->option('verbose')) { |
|
| 25 | $command->blockMessage('Module assets', 'Publishing module assets ...', 'comment'); |
|
| 26 | } |
|
| 27 | ||
| 28 | foreach ($this->modules as $module) { |
|
| 29 | if ($command->option('verbose')) { |
|
| 30 | $command->call('module:publish', ['module' => $module]); |
|
| 31 | continue; |
|
| 32 | } |
|
| 33 | $command->callSilent('module:publish', ['module' => $module]); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 6-35 (lines=30) @@ | ||
| 3 | use Illuminate\Console\Command; |
|
| 4 | use Modules\Core\Console\Installers\SetupScript; |
|
| 5 | ||
| 6 | class ModuleSeeders implements SetupScript |
|
| 7 | { |
|
| 8 | /** |
|
| 9 | * @var array |
|
| 10 | */ |
|
| 11 | protected $modules = [ |
|
| 12 | 'Setting', |
|
| 13 | 'Page', |
|
| 14 | ]; |
|
| 15 | ||
| 16 | /** |
|
| 17 | * Fire the install script |
|
| 18 | * @param Command $command |
|
| 19 | * @return mixed |
|
| 20 | */ |
|
| 21 | public function fire(Command $command) |
|
| 22 | { |
|
| 23 | if ($command->option('verbose')) { |
|
| 24 | $command->blockMessage('Seeds', 'Running the module seeds ...', 'comment'); |
|
| 25 | } |
|
| 26 | ||
| 27 | foreach ($this->modules as $module) { |
|
| 28 | if ($command->option('verbose')) { |
|
| 29 | $command->call('module:seed', ['module' => $module]); |
|
| 30 | continue; |
|
| 31 | } |
|
| 32 | $command->callSilent('module:seed', ['module' => $module]); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||