mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 17:07:01 +01:00
Indirizzi Google Maps per Anagrafiche con azioni di gruppo
This commit is contained in:
parent
d4c8f11d79
commit
61dd791605
@ -49,9 +49,16 @@ switch (post('op')) {
|
|||||||
foreach ($id_records as $id) {
|
foreach ($id_records as $id) {
|
||||||
$anagrafica = Anagrafica::find($id);
|
$anagrafica = Anagrafica::find($id);
|
||||||
if (empty($anagrafica->lat) && empty($anagrafica->lng) && !empty($anagrafica->sedeLegale->citta) && !empty($anagrafica->sedeLegale->cap)) {
|
if (empty($anagrafica->lat) && empty($anagrafica->lng) && !empty($anagrafica->sedeLegale->citta) && !empty($anagrafica->sedeLegale->cap)) {
|
||||||
$address = $geocoder->geocode($anagrafica->sedeLegale->citta.' '.$anagrafica->sedeLegale->cap)->first();
|
$indirizzo = $anagrafica->sedeLegale->citta.' '.$anagrafica->sedeLegale->cap;
|
||||||
|
|
||||||
|
// Ricerca indirizzo
|
||||||
|
$address = $geocoder->geocode($indirizzo)->first();
|
||||||
$coordinates = $address->getCoordinates();
|
$coordinates = $address->getCoordinates();
|
||||||
dd($coordinates);
|
|
||||||
|
// Salvataggio informazioni
|
||||||
|
$anagrafica->lat = $coordinates->getLatitude();
|
||||||
|
$anagrafica->lng = $coordinates->getLongitude();
|
||||||
|
$anagrafica->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user