© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
9 replies
Eric

How to use custom column inside ViewAction

i created a custom column which im using in my table component.

https://filamentphp.com/docs/2.x/tables/columns/custom#view-column
In the docs, i understood that i can also use it inside a view action:
ViewAction::make()
    ->recordTitle(__('game'))
    ->label('')
    ->color('primary')
    ->tooltip(__('See game details'))
    ->modalHeading(__('See game'))
    ->mountUsing(function (\Filament\Forms\ComponentContainer $form, Game $record) {
        $record->load('createdBy');
        $record->load('winner');

        $form->fill($record->toArray());
    })
    ->form([
        Grid::make(4)
            ->schema([
                ViewColumn::make('result')
                    ->view('tables.columns.game-result-column')
                    ->translateLabel()
                ,
...
ViewAction::make()
    ->recordTitle(__('game'))
    ->label('')
    ->color('primary')
    ->tooltip(__('See game details'))
    ->modalHeading(__('See game'))
    ->mountUsing(function (\Filament\Forms\ComponentContainer $form, Game $record) {
        $record->load('createdBy');
        $record->load('winner');

        $form->fill($record->toArray());
    })
    ->form([
        Grid::make(4)
            ->schema([
                ViewColumn::make('result')
                    ->view('tables.columns.game-result-column')
                    ->translateLabel()
                ,
...


but im getting:
Filament\Forms\ComponentContainer::Filament\Forms\Concerns\{closure}(): Argument #1 ($component) must be of type Filament\Forms\Components\Component, Filament\Tables\Columns\ViewColumn given

in the line where i fill the form: $form->fill($record->toArray());
Filament\Forms\ComponentContainer::Filament\Forms\Concerns\{closure}(): Argument #1 ($component) must be of type Filament\Forms\Components\Component, Filament\Tables\Columns\ViewColumn given

in the line where i fill the form: $form->fill($record->toArray());

what should i do?
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

ViewAction on custom page
FilamentFFilament / ❓┊help
3y ago
How to custom text column
FilamentFFilament / ❓┊help
3y ago
Action inside Resource ViewAction blade view
FilamentFFilament / ❓┊help
3y ago
How to use datepicker inside a custom blade component?
FilamentFFilament / ❓┊help
2y ago