javaabu / locations
Countries, states, cities, atolls and islands for Laravel: seedable data for every country (ISO 3166) and every Maldivian atoll and island (official codes, Dhivehi names), admin pages in Blade (javaabu/forms) or Inertia React (@javaabu/forms), and cascading location selects for javaabu/forms, @javaa
Requires
- php: ^8.4
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/routing: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- illuminate/validation: ^12.0 || ^13.0
- illuminate/view: ^12.0 || ^13.0
- javaabu/forms: ^2.0@dev
- javaabu/manifest: ^1.0@dev
- javaabu/permissions: ^3.0@dev
- javaabu/stencil: ^1.0@dev
Requires (Dev)
- inertiajs/inertia-laravel: ^2.0 || ^3.0
- javaabu/boost-javaabu-guidelines: ^1.4
- javaabu/translatable: ^3.0@dev
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.5.3 || ^12.5.8
Suggests
- inertiajs/inertia-laravel: Render the admin pages with Inertia React (^2.0 || ^3.0)
- javaabu/translatable: Translate location names into every active language (^3.0)
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-15 10:52:42 UTC
README
Countries, states, cities, atolls and islands for Laravel:
- Data: all 249 ISO 3166-1 countries (codes, English and Dhivehi names, calling codes), every Maldivian atoll (letter and ISO 3166-2 codes, official names) and every island of the national island register (feature codes, Dhivehi names, categories, coordinates). All seeded from cited, authoritative sources.
- Selects: cascading selects (country → atoll → island) for Blade (javaabu/forms), React (@javaabu/forms) and javaabu/stencil.
- Admin pages: in Blade or Inertia React, authorized with javaabu/permissions.
php artisan migrate php artisan locations:seed
use Javaabu\Locations\Models\Island; $island = Island::findByCode('LD0568'); $island->dhivehi_name; // ދިއްދޫ $island->formattedName('dv'); // ހއ. ދިއްދޫ $island->category->label(); // Residential Island::query()->ofAtoll('HA')->inhabited()->ordered()->get();
<x-forms::form :model="$address"> <x-locations::atoll-select name="atoll_id" child="island_id" /> <x-locations::island-select name="island_id" parent="atoll_id" /> </x-forms::form>
Route::locationOptions(); // what the cascading selects load from Route::locations(['guard' => 'web_admin']); // admin pages for every type
Documentation
The docs are in docs/, and will be published on docs.javaabu.com. For AI assistants, llms.txt lists the rules and every page, and the package ships a Laravel Boost guideline and skill.
Where the data comes from, and what still needs a human to review it: Data sources.
Testing
composer test pnpm install && pnpm test php bin/validate-data.php
Changelog
See CHANGELOG.
Contributing
See CONTRIBUTING.
Security
If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.
Credits
The island register contains information licensed under Data Usage License – Geomatics Department of Ministry of Infrastructure, Housing and Urban Development. Country data comes from Debian's iso-codes (LGPL-2.1-or-later) and Google's libphonenumber (Apache-2.0).
License
The MIT License (MIT). Please see License File for more information.