How to populate options from custom search results

So I was able to manipulate the select search using Gooogle places API.

class GooglePlaceField extends Select
{
    protected string | Closure | null $country;

    protected function setUp(): void
    {
        parent::setup();

        $this->getSearchResultsUsing(static function (Select $component, ?string $search) {
            $places = Places::autocomplete($search, ['types' => 'address']);

            return collect($places)
                ->mapWithKeys(function ($place) {
                    return [$place->placeId() => $place->description()];
                })->toArray();
        });
    }
}


My problem now is how will I populate or display my label as the address from place api with the places id saved on the column?
image.png
Was this page helpful?