Skip to content

Commit 7f1ab0a

Browse files
Edit command
1 parent 20c6413 commit 7f1ab0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Console/GenerateApiResourceCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ protected function generateResource(Model $model): void
163163
protected function buildResource(string $class, string $name): string
164164
{
165165
$properties = $this->properties;
166-
$fields = array_map(function ($field) {
167-
return "'$field' => \$this->$field,";
168-
}, $properties);
166+
$fields = '';
167+
168+
foreach ($properties as $property) {
169+
$fields .= "\t\t\t'$property' => \$this->$property,\n";
170+
}
169171

170172
$stub = $this->files->get($this->stub);
171173

0 commit comments

Comments
 (0)