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'),
            ])

Relationship :
 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)
            ])
Was this page helpful?