© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
jeph

two columns from a single database column

Hello everyone!

Before in v2, I can create two columns from a single database column. But now in v3, when I create a second column from the same database column, the first column will be replaced by the 2nd column. Is there a way to make two columns out of the same database column now in v3?

Sample code:

TextColumn::make('name')
    ->formatStateUsing(function ($state) {
        $names = explode(' ', $state); // Split the full name into an array
        return $names[0]; // First name
    })
    ->label('First Name'),

TextColumn::make('name')
    ->formatStateUsing(function ($state) {
        $names = explode(' ', $state); // Split the full name into an array
        return $names[1] ?? ''; // Last name (or empty string if not available)
    })
    ->label('Last Name'),
TextColumn::make('name')
    ->formatStateUsing(function ($state) {
        $names = explode(' ', $state); // Split the full name into an array
        return $names[0]; // First name
    })
    ->label('First Name'),

TextColumn::make('name')
    ->formatStateUsing(function ($state) {
        $names = explode(' ', $state); // Split the full name into an array
        return $names[1] ?? ''; // Last name (or empty string if not available)
    })
    ->label('Last Name'),
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

Table Columns from Database
FilamentFFilament / ❓┊help
2y ago
Two columns form
FilamentFFilament / ❓┊help
3y ago
BadgeColumn -> condition using values from two columns
FilamentFFilament / ❓┊help
3y ago
2 resource columns from same db column
FilamentFFilament / ❓┊help
3y ago