Skip to content

Commit

Permalink
Inline the variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Dec 26, 2023
1 parent eb4b793 commit be2956d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Fields/Radio.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ class Radio extends Field

protected function defaultProperty(): ?string
{
$default = $this->field->defaultValue();
$options = $this->options;

// A default is only valid if it exists in the options.
return collect($options)->only($default ?? [])->keys()->first();
return collect($this->options)
->only($this->field->defaultValue() ?? [])
->keys()
->first();
}
}

0 comments on commit be2956d

Please sign in to comment.