PHP
MIT License
⭐ 452 Stars

Laravel World Database

Comprehensive geographic data package for Laravel with multilingual support and hierarchical location relationships

Tags

Laravel Database Geolocation i18n Open Source

Project Details

Language: PHP
Stars: 452
License: MIT

Laravel World Database

A robust Laravel package providing comprehensive geographic data management with multilingual support, maintaining hierarchical relationships between continents, countries, states/provinces, and cities.

Overview

Laravel World Database solves the common challenge of managing geographic data in applications by providing a well-structured, standardized database of world locations. With over 450 GitHub stars, it has become a trusted solution for Laravel developers worldwide.

Technical Architecture

Core Components:

  • Complete geographic hierarchy (Continents → Countries → Divisions → Cities)
  • ISO 3166-1 and ISO 3166-2 compliant country and region codes
  • Eloquent models with relationship methods
  • Database seeding and migration system
  • Multilingual support (English, Simplified Chinese, extensible)

Data Quality:

  • Sourced from UN Statistics Division
  • Maintained ISO standard compliance
  • Currency information with ISO codes
  • Country flag emojis and metadata
  • Capital city information

Key Features

Geographic Hierarchy:

  • Navigate from continents down to cities
  • Reverse lookups from cities to countries
  • Query by ISO codes or names
  • Localized name variants

Multilingual Support:

  • Automatic locale detection from Laravel settings
  • Support for local names and aliases
  • Extensible translation system
  • RTL language support ready

Developer-Friendly:

  • Clean Eloquent API
  • Comprehensive query methods
  • Relationship-based data access
  • Well-documented codebase

Business Applications

This package demonstrates expertise in:

  • Data Modeling: Complex hierarchical relationships
  • Internationalization: Multi-language data management
  • Standards Compliance: ISO code implementation
  • Package Development: Laravel ecosystem contribution

Use Cases

E-commerce:

  • Address validation and autocomplete
  • Shipping zone management
  • Multi-region pricing
  • Store locator functionality

User Management:

  • Registration forms with location selection
  • User profile location data
  • Region-based content filtering
  • Analytics and reporting by location

Business Analytics:

  • Geographic sales reporting
  • Market analysis by region
  • Location-based insights
  • International expansion planning

Compliance:

  • GDPR regional requirements
  • Tax jurisdiction management
  • Regional regulation compliance
  • Localized content delivery

Installation

composer require khsing/laravel-world
php artisan migrate
php artisan db:seed --class=WorldSeeder

Example Usage

// Get all countries in a continent
$countries = Country::where('continent_id', $continent->id)->get();

// Find by ISO code
$canada = Country::whereCode('CA')->first();

// Get localized names
$china = Country::whereCode('CN')->first();
echo $china->name;       // "China"
echo $china->local_name; // "中国"

// Navigate relationships
$divisions = $country->divisions;
$cities = $division->cities;

Impact

With 452 stars and active maintenance since Laravel 5.5, this package has been integrated into thousands of Laravel applications worldwide, demonstrating the value of well-designed, standards-compliant open-source solutions.


Developer: Guixing Bai (khsing) License: MIT Compatibility: Laravel 5.5 through 9.x Community: 450+ stars, active maintenance

Contributing to This Project

We welcome contributions from the community! Whether you're fixing a bug, adding a feature, or improving documentation, we'd love your help.

How to Contribute

  1. 1. Fork the repository
  2. 2. Create a feature branch
  3. 3. Make your changes
  4. 4. Add tests if applicable
  5. 5. Submit a pull request

Get Help

  • • Read the contributing guidelines
  • • Check existing issues and PRs
  • • Join our Discord community
  • • Reach out on GitHub Discussions

Need Enterprise Support?

Get professional support, custom development, and consulting for your organization.