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