Best practices for manage address data in a Laravel app.
Hello guys, i'm developing a Laravel app and i need to save the address for multiple models, the client wants to use Google API for the app, i will really appreciate if you can give me some tips, some addresses contains coordinates and others until city, but the common format is country, state, city, postal code and optionally coordinates.
You can also store the coordinate, either in separate latitude and longitude columns, or in an actual geospatial column if you’re going to be querying them a lot.
@The Raf Yeah. An Address model (and addresses table). You can then link to addresses using a foreign key.
If you’re creating addresses from Google Places look-ups, then you may want to also store the Google Place ID with addresses. That way, you can update or create rows using that ID, so you’re not inserting the same Google Place into your database multiple times.