Skip to content

Commit

Permalink
Merge pull request #206 from kitloong/6.x
Browse files Browse the repository at this point in the history
Merge 6.x
  • Loading branch information
kitloong committed Mar 3, 2024
2 parents 8e98343 + 0f007e8 commit 9b74a45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Migration/Writer/MigrationWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ public function writeTo(

$use = implode(Space::LINE_BREAK(), $this->getNamespaces($migrationFileType, $useDBFacade));

// Create directory if it doesn't exist
$directory = dirname($path);

if (!File::exists($directory)) {
File::makeDirectory($directory, 0755, true);
}

File::put(
$path,
$this->migrationStub->populateStub($stub, $use, $className, $upString, $downString)
Expand Down

0 comments on commit 9b74a45

Please sign in to comment.