Skip to content

Commit

Permalink
Merge pull request #10 from abdelmjid-saber/master
Browse files Browse the repository at this point in the history
fix generate model in windows
  • Loading branch information
3x1io authored Feb 22, 2024
2 parents 5f7e59e + e8fe3e2 commit 054d917
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Services/Generator/Concerns/GenerateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ public function generateModel()
}
}
else if(!file_exists(app_path("Models/{$this->modelName}.php"))){
$command = 'krlove:generate:model ' . $this->modelName . ' --table-name=' . $this->tableName . ' --output-path=' . app_path('/Models') . ' --namespace=' . "\\App\\\\Models\\";
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// If the platform is Windows
$outputPath = 'Models';
} else {
// For other platforms
$outputPath = app_path('/Models');
}

$command = 'krlove:generate:model ' . $this->modelName . ' --table-name=' . $this->tableName . ' --output-path=' . $outputPath . ' --namespace=' . "\\App\\Models\\";
}

if(isset($command))
Expand Down

0 comments on commit 054d917

Please sign in to comment.