Merge pull request #17810 from filamentphp/fix/state-casting-issues

fix: State casting issues
This commit is contained in:
Dan Harrin
2025-09-15 13:48:32 +01:00
committed by GitHub
6 changed files with 7 additions and 7 deletions
@@ -329,7 +329,7 @@ class CheckboxList extends Field implements Contracts\CanDisableOptions, Contrac
public function getDefaultStateCasts(): array
{
if ($this->hasCustomStateCasts() || filled($this->getEnum())) {
return [];
return parent::getDefaultStateCasts();
}
return [app(StringArrayStateCast::class)];
@@ -132,7 +132,7 @@ class ModalTableSelect extends Field
->hiddenLabel()
->tableConfiguration($this->getTableConfiguration())
->relationshipName($this->getRelationshipName())
->multiple()
->multiple($this->isMultiple())
->maxItems($this->getMaxItems())
->tableArguments($this->getTableArguments());
@@ -675,7 +675,7 @@ class ModalTableSelect extends Field
public function getDefaultStateCasts(): array
{
if ($this->hasCustomStateCasts()) {
return [];
return parent::getDefaultStateCasts();
}
if ($this->isMultiple()) {
+1 -1
View File
@@ -65,7 +65,7 @@ class Radio extends Field implements Contracts\CanDisableOptions
public function getDefaultStateCasts(): array
{
if ($this->hasCustomStateCasts() || filled($this->getEnum())) {
return [];
return parent::getDefaultStateCasts();
}
return [app(StringStateCast::class, ['isNullable' => true])];
+1 -1
View File
@@ -1408,7 +1408,7 @@ class Select extends Field implements Contracts\CanDisableOptions, Contracts\Has
public function getDefaultStateCasts(): array
{
if ($this->hasCustomStateCasts() || filled($this->getEnum())) {
return [];
return parent::getDefaultStateCasts();
}
if ($this->isMultiple()) {
@@ -313,7 +313,7 @@ class TableSelect extends Field
public function getDefaultStateCasts(): array
{
if ($this->hasCustomStateCasts()) {
return [];
return parent::getDefaultStateCasts();
}
if ($this->isMultiple()) {
@@ -132,7 +132,7 @@ class ToggleButtons extends Field implements Contracts\CanDisableOptions
public function getDefaultStateCasts(): array
{
if ($this->hasCustomStateCasts() || filled($this->getEnum())) {
return [];
return parent::getDefaultStateCasts();
}
if ($this->isMultiple()) {