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:
5 Replies
Virtual columns?
$table->string('first_name')->virtualAs('substring_index(name, \' \', 1)');
$table->string('last_name')->virtualAs('substring_index(name, \' \', -1)');
I have no idea if that works, just copypasted stuffi see.. yeah i think that would work as well. i will go that route if there's no way to do it anymore using only filament. before in v2 its as simple as creating two TextColumn::make('name') with different labels.
Have you tried
->id()
sorry ->id( ) did not work
Method Filament\Tables\Columns\TextColumn::id does not exist.
Sorry I mis-read this as TextInput 🙂 Thought it was a form input.
Can't you use an accessor on your model for this ?
How about