Created
August 27, 2020 15:40
-
-
Save introqt/aaff4ab9a1e8182bd48a7e45b8fa5a03 to your computer and use it in GitHub Desktop.
Revisions
-
introqt created this gist
Aug 27, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,76 @@ <?php declare(strict_types=1); namespace App\Console\Commands; use Illuminate\Console\Command; /** * Class Fresh * * @package App\Console\Commands */ class Fresh extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'fresh'; /** * The console command description. * * @var string */ protected $description = 'Migrates & seeds core & modules'; /** @var array */ private const FIRST_ORDER_MODULES = [ 'Commerce', 'Home', 'Page', 'Product', 'Recommendation', 'Setting', 'User' ]; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle(): void { $this->call('migrate:fresh', [ '--seed' => 1, ]); $this->fillFirstOrderModules(); $this->call('module:seed', ['Menu']); } /** * Fill all besides Menu */ private function fillFirstOrderModules(): void { foreach (self::FIRST_ORDER_MODULES as $MODULE) { $this->call("module:seed", [$MODULE]); } } }