@@ -76,7 +76,9 @@ public function getModule()
7676 $ this ->module = $ modules ->get ( $ this ->argument ( 'namespace ' ) );
7777
7878 if ( $ this ->module ) {
79- if ( $ this ->passDeleteMigration () ) {
79+ if ( $ this ->option ( 'forget ' ) ) {
80+ $ this ->forgetMigration ();
81+ } else {
8082 $ this ->createMigration ();
8183 }
8284 } else {
@@ -89,39 +91,36 @@ public function getModule()
8991 *
9092 * @return bool
9193 */
92- public function passDeleteMigration ()
94+ public function forgetMigration ()
9395 {
94- if ( $ this ->option ( 'forget ' ) ) {
95-
96- /**
97- * This will revert the migration
98- * for a specific module.
99- *
100- * @var ModulesService
101- */
102- $ moduleService = app ()->make ( ModulesService::class );
96+ /**
97+ * This will revert the migration
98+ * for a specific module.
99+ *
100+ * @var ModulesService
101+ */
102+ $ moduleService = app ()->make ( ModulesService::class );
103103
104- $ moduleMigrations = $ moduleService ->getAllModuleMigrationFiles ( $ this ->module );
104+ $ moduleMigrations = $ moduleService ->getAllModuleMigrationFiles ( $ this ->module );
105105
106- if ( count ( $ moduleMigrations ) == 0 ) {
107- $ this ->info ( sprintf ( 'No migration found for the module %s. ' , $ this ->module [ 'name ' ] ) );
106+ if ( count ( $ moduleMigrations ) == 0 ) {
107+ $ this ->info ( sprintf ( 'No migration found for the module %s. ' , $ this ->module [ 'name ' ] ) );
108108
109- return false ;
110- }
109+ return false ;
110+ }
111111
112- /**
113- * The user might want to forget all migration.
114- * We'll then prepend an option for it.
115- */
116- array_unshift ( $ moduleMigrations , __ ( 'All ' ) );
112+ /**
113+ * The user might want to forget all migration.
114+ * We'll then prepend an option for it.
115+ */
116+ array_unshift ( $ moduleMigrations , __ ( 'All ' ) );
117117
118- $ deleteChoice = $ this ->choice ( __ ( 'Which file would you like to forget ' ), $ moduleMigrations , 0 );
118+ $ deleteChoice = $ this ->choice ( __ ( 'Which file would you like to forget ' ), $ moduleMigrations , 0 );
119119
120- if ( $ deleteChoice === __ ( 'All ' ) ) {
121- return $ this ->revertAllModuleMigrations ( $ this ->module );
122- } else {
123- return $ this ->deleteSpecificMigrationPath ( $ deleteChoice );
124- }
120+ if ( $ deleteChoice === __ ( 'All ' ) ) {
121+ return $ this ->revertAllModuleMigrations ( $ this ->module );
122+ } else {
123+ return $ this ->deleteSpecificMigrationPath ( $ deleteChoice );
125124 }
126125 }
127126
0 commit comments