PHPackages                             anouar-touati/algerian-cities-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. anouar-touati/algerian-cities-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

anouar-touati/algerian-cities-laravel
=====================================

A package to facilitate working with algerian cities dataset in Laravel

v1.2.1(2y ago)82981MITPHP

Since Aug 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AnouarTouati/Algerian-Cities-Laravel-Package)[ Packagist](https://packagist.org/packages/anouar-touati/algerian-cities-laravel)[ RSS](/packages/anouar-touati-algerian-cities-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

Algerian Cities Laravel Package
===============================

[](#algerian-cities-laravel-package)

Grew tired of repeating the same step in every project to add address to your forms. I had the same frustration, which why I made this package to get you up and running with just few commands.

Acknowledgment
==============

[](#acknowledgment)

[Dataset was taken from this repo](https://github.com/othmanus/algeria-cities)

Status
======

[](#status)

This package is still under development. Use at your own discretion. You can open an issue for bugs or features you would like to be included in the future.

Instalation
===========

[](#instalation)

```
composer require  anouar-touati/algerian-cities-laravel
```

```
php artisan migrate
```

```
php artisan db:seed --class="AnouarTouati\AlgerianCitiesLaravel\Database\Seeders\AlgerianCitiesSeeder"
```

If auto discovery does not work for you, add this under providers in config/app.php :

```
AnouarTouati\AlgerianCitiesLaravel\AlgerianCitiesServiceProvider::class

```

Usage
=====

[](#usage)

API
---

[](#api)

Call these json endpoints

VerbURIDescriptionGet/api/algeriancities/wilayasGet all wilayas#### response format :

[](#response-format-)

```
[
    {
        "wilaya_code": 3,
        "wilaya_name": "الأغواط",
        "wilaya_name_ascii": "Laghouat"
    },
    {
        "wilaya_code": 4,
        "wilaya_name": "أم البواقي",
        "wilaya_name_ascii": "Oum El Bouaghi"
    },

]
```

VerbURIDescriptionGet/api/algeriancities/dairas/{wilaya}Get all dairas at the specified wilaya code or name (arabic or french)#### response format :

[](#response-format--1)

```
[
    {
        "daira_name": "المنيعة",
        "daira_name_ascii": "El Menia"
    },
    {
        "daira_name": "المنصورة",
        "daira_name_ascii": "Mansourah"
    },

]
```

VerbURIDescriptionGet/api/algeriancities/communes/{daira}Get all communes at the specified daira name (arabic or french)#### response format :

[](#response-format--2)

```
[
    {
        "commune_name": "بئر مراد رايس",
        "commune_name_ascii": "Bir Mourad Rais"
    },
    {
        "commune_name": "بئر خادم",
        "commune_name_ascii": "Birkhadem"
    },

]
```

VerbURIDescriptionGet/api/algeriancities/postoffices/{commune}Get all post offices at the specified commune name (arabic or french)#### response format :

[](#response-format--3)

```
[
    {
        "post_code": 35000,
        "post_name": "بومرداس - القباضة الرئيسية",
        "post_name_ascii": "Boumerdes",
        "post_address": "بومرداس - حي 408 مسكن",
        "post_address_ascii": "Cité 408 Logements Boumerdes"
    },
    {
        "post_code": 35007,
        "post_name": "بومرداس - فرانتز فانون",
        "post_name_ascii": "Boumerdes Frantz Fanon",
        "post_address": "بومرداس - حي 350 مسكن",
        "post_address_ascii": "Cité 350 Logements Boumerdes"
    },

]
```

Use through the AlgerianCitiesFacade
------------------------------------

[](#use-through-the-algeriancitiesfacade)

you can use the methods that the API controller is built with by including this line to the top of your file :

```
use AnouarTouati\AlgerianCitiesLaravel\Facades\AlgerianCitiesFacade;
```

All of these methods return a Collection

MehodParametersDescriptiongetAllWilayas()returns all wilayasgetDairasUsingWilayaCode()$wilaya\_codeget list of dairas using wilaya's codegetDairasUsingWilayaName()$wilaya\_nameget list of dairas using wilaya's name in arabic or frenchgetCommunesUsingDairaName()$daira\_nameget list of communes using daira's name in arabic or frenchgetPostsUsingCommuneName()$commune\_nameget list of post offices using commune's name in arabic or frenchgetAllDairas()get list of all dairasgetAllCommunes()get list of all communesBuilt-in address Blade component
================================

[](#built-in-address-blade-component)

You can add this ready to use component to your form which will provide the HTML dropdowns for selecting the address and the logic to populate them.

You can add styling by passing values to the `:select_style` and `:label_style` props as shown below.

You also need to have the Blade directive `@stack` with the word scripts like so `@stack('scripts')` under the closing body tag if you dont have that already.

Example:

```

        Please fill this form

        Submit

```

Localization
============

[](#localization)

English, French and Arabic translations are available by default for the address form.

If you want to override the default translations you may do so, publish the file to `lang/vendor/algerian-cities-laravel` by running the following command:

```
php artisan vendor:publish --tag=algerian-cities-laravel-localization
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

987d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf19ff87b35592eccc74e431b277831c839d679ede7290d41e05e46c273b8279?d=identicon)[Anouar Touati](/maintainers/Anouar%20Touati)

---

Top Contributors

[![AnouarTouati](https://avatars.githubusercontent.com/u/41107778?v=4)](https://github.com/AnouarTouati "AnouarTouati (32 commits)")

### Embed Badge

![Health badge](/badges/anouar-touati-algerian-cities-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/anouar-touati-algerian-cities-laravel/health.svg)](https://phpackages.com/packages/anouar-touati-algerian-cities-laravel)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
