Skip to content

Data Model

Seven tables, all prefixed lc_ so they don't collide with app tables. Translations use astrotomic/laravel-translatable — a separate row per (model, locale, attribute set).

Overview

lc_regions  ◄───┐
                │ FK (cascade)

lc_countries ───┼──► lc_countries_translations

                ├──► lc_countries_coordinates  (1:1)
                ├──► lc_countries_extras       (1:1)
                └──► lc_countries_geographical (1:1)

lc_regions ────────► lc_region_translations

lc_regions

5 fixed rows: Africa, Americas, Asia, Europe, Oceania.

ColumnTypeNotes
idtinyIncrement
iso_alpha_2string uniqueISO 3166 region code (AF, AM, AS, EU, OC)
icaostringICAO region (AFI, NAT, …)
iucnstringIUCN region
tdwgstringWGSRPD code
is_visibleboolean

lc_region_translations

ColumnTypeNotes
idincrements
lc_region_idFK → lc_regions.id (cascade)
localestring
namestringe.g. "Europe" / "Europa" / "Europa"
slugstring
Unique (lc_region_id, locale) + (slug, locale)

lc_countries

245 countries. Locale-independent data lives here.

ColumnNotes
id, uid (ULID)
lc_region_idFK to region
official_name"Federal Republic of Germany"
native_name"Deutschland" (seeded by NativeNamesSeeder)
capital
iso_alpha_2, iso_alpha_3, iso_numeric
international_phone
geoname_id, wmo
independence_day, population, area, gdp
languages, tld, alternative_tld, borders, timezones, currencyJSON
flag_emoji, flag_colors, flag_colors_web/hex/rgb/cmyk/hsl/hsv/pantone, flag_colors_contrastJSON
is_visibleboolean — filtered out by global scope

Unique on (lc_region_id, iso_alpha_2).

lc_countries_translations

ColumnNotes
lc_country_idFK (cascade)
locale
name"Germany" / "Deutschland" / "Allemagne"
slug"germany" / "deutschland"
Unique (lc_country_id, locale) + (slug, locale)

lc_countries_coordinates

One row per country. Stores the same geographic point in 4 formats:

ColumnExample
latitude, longitude"51.1657", "10.4515"
degrees_with_decimal (dd)"51.1657°N, 10.4515°E"
degrees_minutes_seconds (dms)"51°9'56.52"N, 10°27'5.40"E"
degrees_and_decimal_minutes (dm)"51°9.942'N, 10°27.09'E"
gpsJSON — derived GPS format extensions

lc_countries_geographical

GeoJSON outline (FeatureCollection projected down to a single Feature for each country).

Column
lc_country_id
type (e.g. "FeatureCollection")
features_type (e.g. "Feature")
properties (JSON)
geometry (JSON — Polygon or MultiPolygon)

lc_countries_extras

ColumnNotes
national_sport"Football"
cybersecurity_agencye.g. "BSI"
popular_technologiesJSON array
internetJSON — speed + penetration
religionsJSON array
international_organizationsJSON array — "UN", "EU", "NATO", etc.

Notes on translatable locales

The default configured locales are en + Astrotomic's fallback. All 9 languages ship in the seeder but only show up via accessors if your config/translatable.php lists them as allowed locales.

If you need more, set them in config/translatable.php:

php
'locales' => ['en', 'de', 'fr', 'it', 'nl', 'pt', 'ru', 'es', 'ar'],
'fallback_locale' => 'en',

Released under the MIT License.