Getting started
Installation
Install Malagasy Address with npm or Composer, and add the Laravel or Symfony package if you use one of those frameworks.
Requirements
Section titled “Requirements”| JavaScript | Node.js 22.18+, Bun, Deno, every modern browser. ESM and CommonJS, types included |
| PHP | 8.3 or later |
| Laravel | 12 or 13 |
| Symfony | 7.4 or 8 |
Install
Section titled “Install”@mdgascar/places: works in the browser and on a server. The fokontany load on demand.
npm install @mdgascar/placesmdgascar/malagasy-address: plain PHP, no framework. The fokontany are built in.
composer require mdgascar/malagasy-addressmdgascar/malagasy-address-laravel: adds the mg_place rule, the @mgPlace directive and the AsPlace cast. It installs the PHP package for you.
composer require mdgascar/malagasy-address-laravelmdgascar/malagasy-address-symfony: adds the MalagasyPlace constraint, the mg_place Twig filter and the mg_place Doctrine type. It installs the PHP package for you.
composer require mdgascar/malagasy-address-symfonyFirst call
Section titled “First call”import { findPlace, formatPlace } from '@mdgascar/places';
findPlace('MG11102').name; // 'Antananarivo Avaradrano'formatPlace('MG11102'); // 'Antananarivo Avaradrano, Analamanga'Next, read Places for every function, or check the data on a map.