F
Filament14mo ago
lutek

Multiselect from->getState() empty values

I'm new to Laravel and Filament. Have created custom page where using multiselect will create mutliple records for Document model assigned to "holder". I don't know why getting data from form->getState() doesn't have multiselect values. What am I configuring wrong?
class Document extends Model
{
use HasFactory, HasTranslations;

protected $table = 'document';

protected $guarded = [];

public array $translatable = [];

protected $casts = [
'holders' => 'array',
];

protected static function booted(): void
{
static::addGlobalScope(new OrganizationScope);
}

public function organization(): BelongsTo
{
return $this->belongsTo(Organization::class)->where(['is_master' => 0]);
}

public function documentBase(): BelongsTo
{
return $this->belongsTo(DocumentBase::class)->where(['is_active' => 1]);
}

public function holder(): BelongsTo
{
return $this->belongsTo(Holder::class);
}
}
class Document extends Model
{
use HasFactory, HasTranslations;

protected $table = 'document';

protected $guarded = [];

public array $translatable = [];

protected $casts = [
'holders' => 'array',
];

protected static function booted(): void
{
static::addGlobalScope(new OrganizationScope);
}

public function organization(): BelongsTo
{
return $this->belongsTo(Organization::class)->where(['is_master' => 0]);
}

public function documentBase(): BelongsTo
{
return $this->belongsTo(DocumentBase::class)->where(['is_active' => 1]);
}

public function holder(): BelongsTo
{
return $this->belongsTo(Holder::class);
}
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server