From be33b0175441bfe68e454c6865aede7333ab5010 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Tue, 21 Feb 2023 20:48:31 +0100 Subject: [PATCH] convert , to . --- app/Http/Livewire/City/Form/CityForm.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/Http/Livewire/City/Form/CityForm.php b/app/Http/Livewire/City/Form/CityForm.php index f68a08cf..733ac3f4 100644 --- a/app/Http/Livewire/City/Form/CityForm.php +++ b/app/Http/Livewire/City/Form/CityForm.php @@ -37,23 +37,15 @@ class CityForm extends Component } } - public function updatedCityLongitude($value) - { - $this->city->longitude = str($value) - ->replace(',', '.') - ->toFloat(); - } - - public function updatedCityLatitude($value) - { - $this->city->latitude = str($value) - ->replace(',', '.') - ->toFloat(); - } - public function save() { $this->validate(); + $this->city->longitude = str($this->city->longitude) + ->replace(',', '.') + ->toFloat(); + $this->city->latitude = str($this->city->latitude) + ->replace(',', '.') + ->toFloat(); $this->city->save(); return redirect($this->fromUrl ?? url()->route('welcome'));