mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge pull request #17810 from filamentphp/fix/state-casting-issues
fix: State casting issues
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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])];
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user