Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Location Kit

Laravel Location Kit Laravel Package

erag/laravel-location-kit

Laravel Location Kit provides complete location datasets (countries, states, cities, currencies, timezones, dial codes) with Laravel-friendly APIs: facades/helpers, Blade directives, caching, search, Inertia shared props, plus bundled Vue composables and React hooks.

View on GitHub
Deep Wiki
Context7

Laravel data-only countries, states, cities, currencies, timezones, and dial codes for helpers and Blade.

Frequently asked questions about Laravel Location Kit
Does Laravel Location Kit support Laravel 10+ and PHP 8.2+?
Yes, the package is fully compatible with Laravel 10+ and requires PHP 8.2+. It leverages modern Laravel features like facades, Inertia integration, and service container dependency injection. Always check the latest release notes for minor version updates.
How do I install and set up Laravel Location Kit in my Laravel project?
Run `composer require erag/laravel-location-kit` and then execute `php artisan erag:install-location-kit`. This generates the configuration file and publishes assets. For Vue/React support, install the respective packages via npm (`npm install ./vendor/erag/laravel-location-kit/vue` or React equivalent).
Why are cities disabled by default, and how do I enable them?
The cities dataset (48,313 entries) is large and can impact performance, so it’s disabled by default. Enable it in `config/location-kit.php` by setting `'cities' => true`. Test your application’s load times after enabling, especially if you’re using dropdowns or search features.
Can I override or extend the default location data (e.g., custom cities or currencies)?
Yes, you can override default data by placing custom JSON files in `storage/app/location/`. The package will automatically merge these with the default datasets. This is useful for adding territories (e.g., Puerto Rico) or correcting data inaccuracies. Check the README for the exact file structure.
How do I use Laravel Location Kit with Inertia.js for Vue/React?
Enable Inertia sharing in `config/location-kit.php` by setting `'inertia' => ['enabled' => true]`. Configure which datasets to share (e.g., countries, currencies) and access them via `page.props.locationKit` in your frontend components. No additional API calls are needed for shared data.
Does Laravel Location Kit work with Blade templates without Inertia or frontend frameworks?
Absolutely. The package includes Blade directives like `@locationCountries` and facades (`LocationKit::countries()`) that work independently of Inertia or frontend frameworks. These are ideal for traditional Laravel Blade applications or hybrid setups.
What are the performance implications of enabling the cities dataset?
Enabling cities adds ~48K entries to your application’s memory footprint, which may slow down initial load times, especially on shared hosting. For large dropdowns, consider lazy-loading or pagination. Always benchmark your application after enabling cities to assess the impact.
How often is the location data updated, and can I contribute updates?
The bundled datasets are updated periodically (last update: 2026-05-03), but there’s no public contribution system. For critical updates (e.g., new countries or timezones), use the override feature in `storage/app/location/` or monitor the package’s changelog for major updates.
Are there alternatives for postal codes or real-time geocoding?
Laravel Location Kit focuses on static location data (countries, states, cities). For postal codes, consider packages like `spatie/laravel-postal-codes`. For real-time geocoding (e.g., address validation), integrate with APIs like Google Maps or OpenStreetMap via Laravel HTTP clients.
How do I clear the cache if I update the location data?
Run `php artisan location-kit:clear-cache` to invalidate cached datasets. This ensures your application uses the latest data after overrides or updates. Cache invalidation is manual, so plan for this step during deployments or data updates.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime