© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
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);
    }
}
CreateMultipleDocument.php6.19KB
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

$this->form->getState() empty
FilamentFFilament / ❓┊help
12mo ago
How to get hidden values in getState()
FilamentFFilament / ❓┊help
3y ago
Close multiselect
FilamentFFilament / ❓┊help
10mo ago
Translatable multiselect
FilamentFFilament / ❓┊help
3y ago