From 3311f4df1dc5665a0bfcf7fbd9eee480c04cf45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Robles?= Date: Fri, 6 Oct 2023 14:09:53 +0200 Subject: [PATCH] fix `make:dto` command with array children items --- src/Commands/DtoMakeCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Commands/DtoMakeCommand.php b/src/Commands/DtoMakeCommand.php index 2f6c695..329955e 100644 --- a/src/Commands/DtoMakeCommand.php +++ b/src/Commands/DtoMakeCommand.php @@ -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); }