Skip to content

Installation

Installation

composer require cboxdk/laravel-geo

The GeoServiceProvider is auto-discovered. It:

  • merges config/geo.php (only key: locale, for display names);
  • binds Contracts\JurisdictionRepository as a singleton to the addressing-backed AddressingJurisdictionRepository.

Publish the config if you want to change the reference locale:

php artisan vendor:publish --tag=geo-config

Resolve the repository from the container:

$geo = app(\Cbox\Geo\Contracts\JurisdictionRepository::class);