cheesegrits / filament-google-maps

Google Maps package for Filament PHP
234 stars 65 forks source link

Geocomplete field error trim(): Argument #1 ($string) must be of type string, array given #44

Closed lerc90Mzl closed 1 year ago

lerc90Mzl commented 1 year ago

Hi, I'm using the Geocomplete component and when I choose some location appears de error "trim(): Argument #1 ($string) must be of type string, array given", I need to save lat and lng, the problem is in the class  ComponentAttributeBag.php, the method __toString() expects a string value but the component return an array(lat and lng)

Geocomplete::make('location') ->isLocation() ->reverseGeocode([ 'city' => '%L', 'zip' => '%z', 'state' => '%A1', 'street' => '%n %S', ]) ->countries(['us','co']) ->updateLatLng() ->maxLength(1024) ->prefix('Choose:') ->placeholder('Start typing an address ...') ->geolocate() ->geolocateIcon('heroicon-o-map') ->required(),

Proyect info: Laravel 10.21, filament v3

Thanks for the pluggin!!

trim error

alazark94 commented 1 year ago

Hello, Having the same issue here.

elbaylot commented 1 year ago

Same here

cheesegrits commented 1 year ago

Looking at this issue now.

BTW, quickest way to get hold of me is in the #google-maps channel on the Filament Discord.

cheesegrits commented 1 year ago

OK, I think I've fixed this. It was a regression caused by a recent change in Filament v3.

I need to add some more tests to the test suite and make sure my fix hasn't broken anything else, then I'll push a new version.

cheesegrits commented 1 year ago

Should be fixed in v3.0.5

lerc90Mzl commented 1 year ago

Thank you, I will update my proyect to v3.0.5