[Solved] adding _geoloc to laravel, I am saving my location using Point instead of lat & lng as well using Postgress Postgris

Been Following this tutorial. My issue is that I stored my positions with Point instead of
latitude and longitude.
gnome-shell-screenshot-TJKQK0

    public function toSearchableArray()
    {
        $record = $this->toArray();

        $record['_geoloc'] = [
            'lat' => $record['latitude'],
            'lng' => $record['longitude'],
        ];

        unset($record['created_at'], $record['updated_at']); // Remove unrelevant data
        unset($record['latitude'], $record['longitude']);

        return $record;
    }

Already resolved it

public function toSearchableArray()
{
    $record = $this->toArray();

    $record['_geoloc'] = [
        'lat' => $this->location->getLat(),
        'lng' => $this->location->getLng(),
    ];

    unset($record['created_at'], $record['updated_at']); // Remove unrelevant data

    return $record;
}