I am beginner in Laravel. I use Laravel 5.8 in my project.
I have this object:
NominatimAddress {#1146 ▼
-attribution: "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright"
-category: "building"
-displayName: "99, 9 Maja, Janowo, Olsztyn, powiat pomorski, pomorskie, "
-osmType: "way"
-osmId: 142789154
-type: "yes"
-coordinates: Coordinates {#1147 ▼
-latitude: 51.51171143
-longitude: 11.4023121
}
-bounds: Bounds {#1148 ▶}
-adminLevels: AdminLevelCollection {#1149 ▶}
-country: Country {#1152 ▶}
-timezone: null
-providedBy: "nominatim"
}
How can I get latitude and longitude from this object?
->.$object->coordinates->latitudeprotectedorprivate, hence not accessible from the outside. Since you didn't include what libraries are you using in the question, I'm gonna venture a guess and say that you try$object->coordinates->getLatitude()and$object->coordinates->getLongitude()as most of the time private properties that need access are hidden behind getters and setters. But as a general rule of thumb please try to include as much information in your question as you can, because it helps you get faster and more accurate answers.