@@ -63,7 +63,7 @@ public function migrateAll(): self
6363 $ migratedFileNames = $ this ->migrationRepository ->getAll ();
6464
6565 $ nonMigratedFiles = $ files ->filter (function (MigrationFile $ file ) use ($ migratedFileNames ) {
66- return ! $ migratedFileNames ->contains ($ file ->getName ());
66+ return ! $ migratedFileNames ->contains ($ file ->name ());
6767 });
6868
6969 $ this ->migrate ($ nonMigratedFiles );
@@ -80,10 +80,10 @@ public function rollbackOne(string $fileName): self
8080
8181 if (is_null ($ file )) {
8282 $ this ->output ->writeln ('<error>Migration is not found:</error> ' .$ fileName );
83- } elseif (! $ this ->migrationRepository ->exists ($ file ->getName ())) {
84- $ this ->output ->writeln ('<error>Migration is not yet migrated:</error> ' .$ file ->getName ());
83+ } elseif (! $ this ->migrationRepository ->exists ($ file ->name ())) {
84+ $ this ->output ->writeln ('<error>Migration is not yet migrated:</error> ' .$ file ->name ());
8585 } else {
86- $ this ->rollback (collect ([$ file ->getName ()]));
86+ $ this ->rollback (collect ([$ file ->name ()]));
8787 }
8888
8989 return $ this ;
@@ -127,9 +127,9 @@ public function showStatus(): self
127127
128128 $ rows = $ files ->map (function (MigrationFile $ file ) use ($ migratedFileNames , $ migratedLastBatchFileNames ) {
129129 return [
130- $ migratedFileNames ->contains ($ file ->getName ()) ? '<info>Yes</info> ' : '<comment>No</comment> ' ,
131- $ migratedLastBatchFileNames ->contains ($ file ->getName ()) ? '<info>Yes</info> ' : '<comment>No</comment> ' ,
132- $ file ->getName (),
130+ $ migratedFileNames ->contains ($ file ->name ()) ? '<info>Yes</info> ' : '<comment>No</comment> ' ,
131+ $ migratedLastBatchFileNames ->contains ($ file ->name ()) ? '<info>Yes</info> ' : '<comment>No</comment> ' ,
132+ $ file ->name (),
133133 ];
134134 })->toArray ();
135135
@@ -154,14 +154,14 @@ protected function migrate(Collection $files): self
154154 $ nextBatchNumber = $ this ->migrationRepository ->getLastBatchNumber () + 1 ;
155155
156156 $ files ->each (function (MigrationFile $ file ) use ($ nextBatchNumber ) {
157- $ this ->output ->writeln ('<comment>Migrating:</comment> ' .$ file ->getName ());
157+ $ this ->output ->writeln ('<comment>Migrating:</comment> ' .$ file ->name ());
158158
159159 $ migration = $ this ->migrationFactory ->makeFromFile ($ file );
160160 $ migration ->up ();
161161
162- $ this ->migrationRepository ->insert ($ file ->getName (), $ nextBatchNumber );
162+ $ this ->migrationRepository ->insert ($ file ->name (), $ nextBatchNumber );
163163
164- $ this ->output ->writeln ('<info>Migrated:</info> ' .$ file ->getName ());
164+ $ this ->output ->writeln ('<info>Migrated:</info> ' .$ file ->name ());
165165 });
166166
167167 return $ this ;
@@ -186,22 +186,22 @@ protected function rollback(Collection $fileNames): self
186186 $ this ->output ->writeln (
187187 '<error>Migration is not found:</error> ' .
188188 implode (', ' , $ fileNames ->diff ($ files ->map (function (MigrationFile $ file ) {
189- return $ file ->getName ();
189+ return $ file ->name ();
190190 }))->toArray ())
191191 );
192192
193193 return $ this ;
194194 }
195195
196196 $ files ->each (function (MigrationFile $ file ) {
197- $ this ->output ->writeln ('<comment>Rolling back:</comment> ' .$ file ->getName ());
197+ $ this ->output ->writeln ('<comment>Rolling back:</comment> ' .$ file ->name ());
198198
199199 $ migration = $ this ->migrationFactory ->makeFromFile ($ file );
200200 $ migration ->down ();
201201
202- $ this ->migrationRepository ->delete ($ file ->getName ());
202+ $ this ->migrationRepository ->delete ($ file ->name ());
203203
204- $ this ->output ->writeln ('<info>Rolled back:</info> ' .$ file ->getName ());
204+ $ this ->output ->writeln ('<info>Rolled back:</info> ' .$ file ->name ());
205205 });
206206
207207 return $ this ;
0 commit comments