From b0ffef5fb615ea9bd5557b88beee9315f331c292 Mon Sep 17 00:00:00 2001 From: tcampbPPU Date: Mon, 9 Jan 2023 20:48:05 -0500 Subject: [PATCH] Cast Hidden as Undefined --- src/Actions/BuildModelDetails.php | 3 ++- src/Actions/WriteColumnAttribute.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Actions/BuildModelDetails.php b/src/Actions/BuildModelDetails.php index 55676b2..ac1ecec 100644 --- a/src/Actions/BuildModelDetails.php +++ b/src/Actions/BuildModelDetails.php @@ -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 diff --git a/src/Actions/WriteColumnAttribute.php b/src/Actions/WriteColumnAttribute.php index 300c360..1c14df4 100644 --- a/src/Actions/WriteColumnAttribute.php +++ b/src/Actions/WriteColumnAttribute.php @@ -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,