Skip to content

Commit

Permalink
Merge pull request #20 from fumeapp/hidden-properties
Browse files Browse the repository at this point in the history
Cast Hidden as Undefined
  • Loading branch information
acidjazz authored Jan 10, 2023
2 parents 084aa1e + b0ffef5 commit c4a84e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Actions/BuildModelDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class BuildModelDetails
/**
* Build the model details.
*
* @param SplFileInfo $modelFile
* @param SplFileInfo $modelFile
* @return array
*
* @throws ReflectionException
*/
public function __invoke(SplFileInfo $modelFile): array
Expand Down
4 changes: 4 additions & 0 deletions src/Actions/WriteColumnAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ public function __invoke(ReflectionClass $reflectionModel, array $attribute, str
$type .= '|null';
}

if (isset($attribute['hidden']) && $attribute['hidden']) {
$name = "{$name}?";
}

if ($jsonOutput) {
return [[
'name' => $name,
Expand Down

0 comments on commit c4a84e7

Please sign in to comment.