© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
21 replies
codeartisan

Dynamically create a column in the

                Tables\Columns\TextColumn::make('date')
                    ->date()
                    ->sortable(),
                Tables\Columns\TextColumn::make('user_amount')
                    ->searchable()
                    ->toggleable()
                    ->sortable()
                    ->label('Money from Safe'),
                Tables\Columns\TextColumn::make('system_amount')
                    ->searchable()
                    ->toggleable()
                    ->sortable()
                    ->label('System Amount')
                    ->sortable(),
                Tables\Columns\TextColumn::make('difference')
                    ->label('Difference')
                    ->formatStateUsing(function (Model $record) {
                        die($record);
                        return $record->user_amount - $record->system_amount;
                    }),
                Tables\Columns\TextColumn::make('type')
                    ->searchable(),
                Tables\Columns\TextColumn::make('date')
                    ->date()
                    ->sortable(),
                Tables\Columns\TextColumn::make('user_amount')
                    ->searchable()
                    ->toggleable()
                    ->sortable()
                    ->label('Money from Safe'),
                Tables\Columns\TextColumn::make('system_amount')
                    ->searchable()
                    ->toggleable()
                    ->sortable()
                    ->label('System Amount')
                    ->sortable(),
                Tables\Columns\TextColumn::make('difference')
                    ->label('Difference')
                    ->formatStateUsing(function (Model $record) {
                        die($record);
                        return $record->user_amount - $record->system_amount;
                    }),
                Tables\Columns\TextColumn::make('type')
                    ->searchable(),

I want to create a field called difference
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

Create a page dynamically
FilamentFFilament / ❓┊help
12mo ago
How to create custom column in the table?
FilamentFFilament / ❓┊help
3y ago
A calculated column in the table
FilamentFFilament / ❓┊help
2y ago
How to create a dynamically hidden header button?
FilamentFFilament / ❓┊help
3y ago