FilamentF
Filament2y ago
Wim

Filament table enum: enum does not exist

I have a database table where a column 'organization' can be 0 or 1 (non-organization or organization). The column type is tinyint(1). I was using the following code with an enum() function

           Tables\Columns\TextColumn::make('organization')
                    ->badge()
                    ->color(fn (string $state): string => match ($state) {
                        '0' => 'danger',
                        '1' => 'info'
                    })
                    ->enum([
                        '0' => 'Non-Organization',
                        '1' => 'Organization',
                    ]),

But I'm getting Method Filament\Tables\Columns\TextColumn::enum does not exist. error.

Any ideas?
Was this page helpful?