© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Oumaima

concatenate value in text column

I have a order table , which has user name Column , And I want to concatenate the firstname and lastname of this relationship , what should I do :
 ->columns([
                Tables\Columns\TextColumn::make('user.firstname')
                ->label('User name'),
            ])
 ->columns([
                Tables\Columns\TextColumn::make('user.firstname')
                ->label('User name'),
            ])

Relationship :
 public function user(){
        return $this->belongsTo(User::class);
    }
 public function user(){
        return $this->belongsTo(User::class);
    }
Solution
->columns([
           Tables\Columns\TextColumn::make('user')
                ->label('User name'),
                ->formatStateUsing(fn($state) => $state.firstname . ' ' . $state->lastname)
            ])
->columns([
           Tables\Columns\TextColumn::make('user')
                ->label('User name'),
                ->formatStateUsing(fn($state) => $state.firstname . ' ' . $state->lastname)
            ])
Jump to solution
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

concatenate in titleAttribute
FilamentFFilament / ❓┊help
3y ago
html + limit in text column
FilamentFFilament / ❓┊help
3y ago
Using column value or $state in other column
FilamentFFilament / ❓┊help
3y ago
Text column copyable()
FilamentFFilament / ❓┊help
2y ago