mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
convert , to .
This commit is contained in:
@@ -21,22 +21,36 @@ class CityForm extends Component
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'city.country_id' => 'required',
|
'city.country_id' => 'required',
|
||||||
'city.name' => 'required|string',
|
'city.name' => 'required|string',
|
||||||
'city.longitude' => 'required',
|
'city.longitude' => 'required',
|
||||||
'city.latitude' => 'required',
|
'city.latitude' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
if (! $this->city) {
|
if (!$this->city) {
|
||||||
$this->city = new City();
|
$this->city = new City();
|
||||||
}
|
}
|
||||||
if (! $this->fromUrl) {
|
if (!$this->fromUrl) {
|
||||||
$this->fromUrl = url()->previous();
|
$this->fromUrl = url()->previous();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public function save()
|
||||||
{
|
{
|
||||||
$this->validate();
|
$this->validate();
|
||||||
|
|||||||
Reference in New Issue
Block a user