Organizing a collection

Tables\Columns\TextColumn::make('userLocations')
->label('Locations')
->searchable()
->sortable()
->badge()
->formatStateUsing(
fn(Model $record) => $record->userLocations->map(
fn($location) => $location->country->name . ' ' . $location->state->name
)->implode(PHP_EOL)
)
Tables\Columns\TextColumn::make('userLocations')
->label('Locations')
->searchable()
->sortable()
->badge()
->formatStateUsing(
fn(Model $record) => $record->userLocations->map(
fn($location) => $location->country->name . ' ' . $location->state->name
)->implode(PHP_EOL)
)
so I have this code. and i wanted the output to be like:
Botswana Chobe
Andorra Encamp
Botswana Chobe
Andorra Encamp
but the output i get is
Botswana Chobe Andorra Encamp
Botswana Chobe Andorra Encamp
Botswana Chobe Andorra Encamp
Botswana Chobe Andorra Encamp
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server