Skip to content

Commit

Permalink
fix make:dto command with array children items
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Oct 6, 2023
1 parent 6c18a23 commit 3311f4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Commands/DtoMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ protected function getProperties(string $requestClass)

// TODO: Sort nulls here to be prepended (need to create array first)
foreach ($requestRules as $property => $rules) {
if (str_contains($property, '.')) {
continue;
}

if (str_ends_with('_id', $property)) {
$property = preg_replace('/_id$/', '', $property);
}
Expand Down

0 comments on commit 3311f4d

Please sign in to comment.