File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed
Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ public function getInfo(): ?string
6161
6262 public function getConfirmableLabel (): ?string
6363 {
64- return 'Warning ' ;
64+ return 'Application In Production ' ;
65+ }
66+
67+ public function getConfirmableCallback (): \Closure |bool |null
68+ {
69+ return null ;
6570 }
6671
6772 /**
@@ -71,8 +76,8 @@ public function handle()
7176 {
7277 if ($ this instanceof ConfirmableCommand) {
7378 if ($ this ->isProhibited () ||
74- ! $ this ->confirmToProceed ($ this ->getConfirmableLabel (), fn () => true )) {
75- return 1 ;
79+ ! $ this ->confirmToProceed ($ this ->getConfirmableLabel (), $ this -> getConfirmableCallback () )) {
80+ return Command:: FAILURE ;
7681 }
7782 }
7883
Original file line number Diff line number Diff line change 55use Illuminate \Database \Migrations \Migrator ;
66use Illuminate \Support \Collection ;
77use Nwidart \Modules \Commands \BaseCommand ;
8+ use Nwidart \Modules \Contracts \ConfirmableCommand ;
89use Symfony \Component \Console \Input \InputOption ;
910
10- class MigrateFreshCommand extends BaseCommand
11+ class MigrateFreshCommand extends BaseCommand implements ConfirmableCommand
1112{
1213 /**
1314 * The console command name.
Original file line number Diff line number Diff line change 33namespace Nwidart \Modules \Commands \Database ;
44
55use Nwidart \Modules \Commands \BaseCommand ;
6+ use Nwidart \Modules \Contracts \ConfirmableCommand ;
67use Symfony \Component \Console \Input \InputOption ;
78
8- class MigrateRefreshCommand extends BaseCommand
9+ class MigrateRefreshCommand extends BaseCommand implements ConfirmableCommand
910{
1011 /**
1112 * The console command name.
Original file line number Diff line number Diff line change 33namespace Nwidart \Modules \Commands \Database ;
44
55use Nwidart \Modules \Commands \BaseCommand ;
6+ use Nwidart \Modules \Contracts \ConfirmableCommand ;
67use Nwidart \Modules \Migrations \Migrator ;
78use Nwidart \Modules \Traits \MigrationLoaderTrait ;
89use Symfony \Component \Console \Input \InputOption ;
910
10- class MigrateResetCommand extends BaseCommand
11+ class MigrateResetCommand extends BaseCommand implements ConfirmableCommand
1112{
1213 use MigrationLoaderTrait;
1314
You can’t perform that action at this time.
0 commit comments