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


so I have this code. and i wanted the output to be like:

Botswana Chobe
Andorra Encamp


but the output i get is

Botswana Chobe Andorra Encamp
Botswana Chobe Andorra Encamp
Was this page helpful?