Skip to content

Commit

Permalink
Add Model namespace to Enum
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-de-wit committed Jul 20, 2021
1 parent c68cf50 commit 8ae93f5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Directives/VariantDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ public function manipulateArgDefinition(
$variants = $allowedVariants;
}

$resizeEnumName = Str::studly($parentField->name->value) . Str::studly($argDefinition->name->value);
$resizeEnumName = ASTHelper::modelName($parentType) . Str::studly($parentField->name->value) . Str::studly($argDefinition->name->value);
$argDefinition->type = Parser::namedType($resizeEnumName);


$enumValues = collect($variants)->map(function (string $variant) {
return strtoupper($variant) . ' @enum(value: "' . $variant . '")';
});
Expand Down

0 comments on commit 8ae93f5

Please sign in to comment.