PHPackages                             elaborate-code/laravel-algerian-provinces - 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. [Database &amp; ORM](/categories/database)
4. /
5. elaborate-code/laravel-algerian-provinces

ActiveLibrary[Database &amp; ORM](/categories/database)

elaborate-code/laravel-algerian-provinces
=========================================

Add a table of algerian provinces to your project

v2.0.0(3y ago)1038[4 PRs](https://github.com/al-jazair/laravel-algerian-provinces/pulls)MITPHPPHP ^8.1

Since Jul 26Pushed 1y agoCompare

[ Source](https://github.com/al-jazair/laravel-algerian-provinces)[ Packagist](https://packagist.org/packages/elaborate-code/laravel-algerian-provinces)[ Docs](https://github.com/elaborate-code/laravel-algerian-provinces)[ RSS](/packages/elaborate-code-laravel-algerian-provinces/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (9)Used By (0)

Laravel Algerian provinces
==========================

[](#laravel-algerian-provinces)

[![Packagist Version](https://camo.githubusercontent.com/38abff8884f94932709ee5c5afaddd4c1fb6b673760b7001b05fe35841ed7c90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/38abff8884f94932709ee5c5afaddd4c1fb6b673760b7001b05fe35841ed7c90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365733f7374796c653d666f722d7468652d6261646765)[![Packagist Downloads](https://camo.githubusercontent.com/1b31ca4b1e6edc9bdc247bbc9066e3f4a8eadd9701be17736c4813053c0a4cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/1b31ca4b1e6edc9bdc247bbc9066e3f4a8eadd9701be17736c4813053c0a4cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365733f7374796c653d666f722d7468652d6261646765)[![GitHub Workflow Status](https://camo.githubusercontent.com/0a1a086a7161ac803095a26afe4a588e11078184dd6535367036845fd48a8d95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365732f72756e2d74657374733f6c6162656c3d5465737473267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/0a1a086a7161ac803095a26afe4a588e11078184dd6535367036845fd48a8d95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365732f72756e2d74657374733f6c6162656c3d5465737473267374796c653d666f722d7468652d6261646765)[![GitHub Workflow Status](https://camo.githubusercontent.com/ffeda0a29d1f22c74ccefba6d31509bb845494006913326a0069ae5c1a2d97c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365732f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d436f64652532305374796c65267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/ffeda0a29d1f22c74ccefba6d31509bb845494006913326a0069ae5c1a2d97c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f656c61626f726174652d636f64652f6c61726176656c2d616c67657269616e2d70726f76696e6365732f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d436f64652532305374796c65267374796c653d666f722d7468652d6261646765)

[![banner](https://camo.githubusercontent.com/60e63f9242a69e7dbf91fc060b70aa6592ea7a2b6477bac9a55c39753b740d22/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f416c67657269616e25323070726f76696e6365732e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d656c61626f726174652d636f64652532466c61726176656c2d616c67657269616e2d70726f76696e636573267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d412b6d6f64656c2b7365656465642b776974682b7468652b35382b416c67657269616e2b70726f76696e6365732b666f722b4c61726176656c2b61707073266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d6461746162617365)](https://camo.githubusercontent.com/60e63f9242a69e7dbf91fc060b70aa6592ea7a2b6477bac9a55c39753b740d22/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f416c67657269616e25323070726f76696e6365732e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d656c61626f726174652d636f64652532466c61726176656c2d616c67657269616e2d70726f76696e636573267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d412b6d6f64656c2b7365656465642b776974682b7468652b35382b416c67657269616e2b70726f76696e6365732b666f722b4c61726176656c2b61707073266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d6461746162617365)

[Algerian provinces](wilayas.md) Eloquent model for Laravel applications.

Installation
------------

[](#installation)

Install the package via composer:

```
composer require elaborate-code/laravel-algerian-provinces
```

Requirements:

1. SQLite.

### Publishing config file \[Optional\]

[](#publishing-config-file-optional)

You can publish the config file with:

```
php artisan vendor:publish --tag="algerian-provinces-config"
```

This is the contents of the published config file:

```
return [
    'columns_names' => [
        'fr_name' => null, // defaults to fr_name
        'ar_name' => null, // defaults to ar_name
    ],
];
```

That allows you to rename `columns` names.

Usage
-----

[](#usage)

Now you have access to the `ElaborateCode\AlgerianProvinces\Models\Wilaya`

```
use ElaborateCode\AlgerianProvinces\Models\Wilaya;

$wilayas = Wilaya::all();

$wilayas = Wilaya::find(31); // Model of: ["id" => 31, "fr_name" => "Oran", "ar_name" => "وهران"]

$wilayas = Wilaya::arr(); // Wilaya::all()->toArray()

$fr_names = Wilaya::frNames(); // Wilaya::pluck('fr_name')

$ar_names = Wilaya::arNames(); // Wilaya::pluck('ar_name')
```

```
namespace App\Models;

use ElaborateCode\AlgerianProvinces\Models\Wilaya;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class User extends Model
{
    // use as relationship

    public function birthWilaya(): BelongsTo
    {
        return $this->belongsTo(Wilaya::class, 'birth_wilaya', 'fr_name');
    }
}
```

Sushi
-----

[](#sushi)

This package requires 0 config, and comes with no migrations or seeders thanks to the wonderful package [calebporzio/sushi](https://github.com/calebporzio/sushi). That allows us to offer a ready to use model without going the extra steps of affecting your database.

> However this dependency requires SQLite to be setup on your system!

If you prefer having a table in your database checkout [v1](https://github.com/elaborate-code/laravel-algerian-provinces/tree/v1-migration) which doesn't depand on calebporzio/sushi.

Testing
-------

[](#testing)

```
vendor/bin/pint
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 57.9% 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 ~36 days

Total

2

Last Release

1348d ago

Major Versions

1.0.0 → v2.0.02022-09-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/e024d85d6159f76c1b1bc9c0608bdd2afab8b0724d0b9bb9ae45bf2a837d343f?d=identicon)[medilies](/maintainers/medilies)

---

Top Contributors

[![medilies](https://avatars.githubusercontent.com/u/35309918?v=4)](https://github.com/medilies "medilies (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")[![ghs-medilies](https://avatars.githubusercontent.com/u/93465882?v=4)](https://github.com/ghs-medilies "ghs-medilies (1 commits)")

---

Tags

algeriacitiesdatabseeloquentlaravelmodelpackageprovincesstatesstructurewilayalaravelseederAlgerian provinces

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elaborate-code-laravel-algerian-provinces/health.svg)

```
[![Health](https://phpackages.com/badges/elaborate-code-laravel-algerian-provinces/health.svg)](https://phpackages.com/packages/elaborate-code-laravel-algerian-provinces)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

203330.1k2](/packages/wnx-laravel-backup-restore)

PHPackages © 2026

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