Download the PHP package ihangan/laravel-moldova-cuatm without Composer

On this page you can find all versions of the php package ihangan/laravel-moldova-cuatm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-moldova-cuatm

Moldova CUATM for Laravel

Latest version Tests PHPStan Total downloads

Every administrative-territorial unit of the Republic of Moldova, as an Eloquent model you can query straight away. The data comes from CUATM, the official classifier maintained by the National Bureau of Statistics, so the codes and the hierarchy match what government systems use.

You get the 32 raioane, the municipalities, the sectors of Chișinău, every town and all ~1,600 villages, plus Gagauzia and the Stînga Nistrului units. Each one carries its official CUATM code, a parent link, names in Romanian, Russian and Ukrainian, and WGS84 coordinates.

I built this for a rental classifieds site that needed a real location tree (region → city → sector → village) instead of a free-text address field, and pulled it out into a package because the dataset is useful on its own.

Requirements

Installation

Publish and run the migration, then load the data:

cuatm:import is idempotent, so you can run it again whenever a new CUATM edition ships without ending up with duplicates.

Usage

The model is Ihangan\MoldovaCuatm\Models\Location. It behaves like any other Eloquent model.

Names

Names are translatable (backed by spatie/laravel-translatable). Romanian is always present; Russian and Ukrainian exist for most localities; English is filled in for the larger cities.

Set a fallback once (for example in a service provider) so a missing locale returns Romanian instead of an empty string:

Hierarchy

The tree is a self-referencing parent_id.

Coordinates

Facade

A small facade wraps the common lookups when you would rather not write the queries by hand:

Cascading location picker

roots() and childrenOf() are all you need to build a "pick a region, then a locality below it" selector. The hierarchy isn't a fixed depth (a raion goes straight to its villages, while Chișinău goes municipality → sector → town → village), so the picker keeps offering another dropdown while the chosen unit still has children.

The selected location is the last entry in $path. Outside Livewire the same two calls drive any UI: render Cuatm::roots() first, then Cuatm::childrenOf($id) each time a level is chosen.

Configuration

Publish the config file if you need to change the table name, the connection or the locales:

The table is named cuatm_locations rather than locations so it does not clash with one your application may already have.

Data and updates

The dataset lives in database/data/cuatm.json and ships with the package.

CUATM changes rarely. When the Bureau publishes a new edition, replace the JSON file and run php artisan cuatm:import again.

Testing

Changelog

See releases.

Contributing

See CONTRIBUTING.md.

Security

Found a security issue? Email [email protected] instead of using the issue tracker. See SECURITY.md.

Credits

License

The MIT License. See LICENSE.md.

The administrative data is public information from the National Bureau of Statistics of Moldova; Wikidata content is CC0.


All versions of laravel-moldova-cuatm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^12.0 || ^13.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
spatie/laravel-package-tools Version ^1.92
spatie/laravel-translatable Version ^6.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ihangan/laravel-moldova-cuatm contains the following files

Loading the files please wait ...