© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
blackdog308

Filter table with metadata column

Hi everyone,

I have a table where the displayed information is from the primary table + joined column from the metadata table. My Select Filters work for the columns on the main table, but when I run my select filter on the joined metadata table, I get an error stating the column 'status' cannot be found on the table.


Attribute on the primary table model
protected function status(): Attribute
    {
        return Attribute::make(
            get: fn () => $this->attributes()->where('key', 'status')->first()->value ?? null,
            set: fn ($value) => $this->attributes()->updateOrCreate(['key' => 'status'], ['value' => $value])
        );
    }
protected function status(): Attribute
    {
        return Attribute::make(
            get: fn () => $this->attributes()->where('key', 'status')->first()->value ?? null,
            set: fn ($value) => $this->attributes()->updateOrCreate(['key' => 'status'], ['value' => $value])
        );
    }

Column on the Primary Table

SelectColumn::make('status')
                    ->options(ResourceOption::where('resource', 'renewals')->get()->keyBy('id')->map(fn ($item) => $item->name)->toArray())
                    ->placeholder(''),

SelectColumn::make('status')
                    ->options(ResourceOption::where('resource', 'renewals')->get()->keyBy('id')->map(fn ($item) => $item->name)->toArray())
                    ->placeholder(''),

Select Filter on the Primary Table for the Metadata column

                SelectFilter::make('status')
                    ->options(
                        ResourceOption::where('resource', 'renewals')
                            ->where('type', 'status')
                            ->get()
                            ->keyBy('id')
                            ->map(fn ($item) => $item->name)
                            ->toArray()
                    )
                    ->multiple(),

                SelectFilter::make('status')
                    ->options(
                        ResourceOption::where('resource', 'renewals')
                            ->where('type', 'status')
                            ->get()
                            ->keyBy('id')
                            ->map(fn ($item) => $item->name)
                            ->toArray()
                    )
                    ->multiple(),
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

filter table column relation
FilamentFFilament / ❓┊help
3y ago
Table filter below column?
FilamentFFilament / ❓┊help
3y ago
Filter in table with a polymorphic Column
FilamentFFilament / ❓┊help
3y ago
Column not found with table filter and joins
FilamentFFilament / ❓┊help
2y ago