Use laravel-postgis properly

This commit is contained in:
Jonny Barnes 2016-06-27 10:43:47 +01:00
parent 8d39356375
commit 04de40c2de
3 changed files with 14 additions and 14 deletions

View file

@ -41,8 +41,7 @@ class NotesController extends Controller
}
}
if ($note->place !== null) {
preg_match('/\((.*)\)/', $note->place->location, $matches);
$lnglat = explode(' ', $matches[1]);
$lnglat = explode(' ', $note->place->location);
$note->latitude = $lnglat[1];
$note->longitude = $lnglat[0];
$note->address = $note->place->name;
@ -110,8 +109,7 @@ class NotesController extends Controller
}
}
if ($note->place !== null) {
preg_match('/\((.*)\)/', $note->place->location, $matches);
$lnglat = explode(' ', $matches[1]);
$lnglat = explode(' ', $note->place->location);
$note->latitude = $lnglat[1];
$note->longitude = $lnglat[0];
$note->address = $note->place->name;