Logo Lanfrica

Yonkuru/Rwanda-Administrative-Divisions-Laravel-Seeder

Domain:

digital infrastructure
Creator:
Yon
Host:
Rwanda Local Government Entities Laravel Seeder for Provinces, Districts and Sectors # Rwanda Administrative Divisions - Laravel Seeders ## πŸ“Œ Overview This repository provides a complete Rwanda's administrative divisions structure (Provinces, Districts, Sectors, Cells, and Villages) that will be helpful to software developers especially for Laravel applications developers. ## πŸš€ Implementation 1. **Copy these files to your Laravel project:** - Models: `app/Models/` (Province.php, District.php, Sector.php, Cell.php, Village.php) - Migrations: `database/migrations/` (create_rw_*_tables.php) - Seeders: `database/seeders/` (*Seeder.php) **OR** **Clone the whole repository (Not recommended)** ```bash git clone github.com ``` 2. **Run migrations:** ```bash php artisan migrate ``` 3. **Seed the database (optional):** ```bash php artisan db:seed ``` ## πŸ”§ Database Structure The package creates the following tables with relationships: 1. **rw_provinces** - Rwanda's provinces - *prv_id* (primary key) - *prv_name* - *timestamps* 2. **rw_districts** - Districts within provinces - *dst_id* (primary key) - *dst_province* (foreign key to rw_provinces) - *dst_name* - *timestamps* 3. **rw_sectors** - Sectors within districts - *sct_id* (primary key) - *sct_district* (foreign key to rw_districts) - *sct_name* - *timestamps* 4. **rw_cells** - Cells within sectors - *cel_id* (primary key) - *cel_sector* (foreign key to rw_sectors) - *cel_name* - *timestamps* 5. **rw_villages** - Villages within cells - *vlg_id* (primary key) - *vlg_cell* (foreign key to rw_cells) - *vlg_name* - *timestamps* ## πŸ—οΈ Relationships - *Province β†’ hasMany β†’ District* - *District β†’ belongsTo β†’ Province* - *District β†’ hasMany β†’ Sector* - *Sector β†’ belongsTo β†’ District* - *Sector β†’ hasMany β†’ Cell* - *Cell β†’ belongsTo β†’ Sector* - *Cell β†’ hasMany β†’ Village* - *Village β†’ belongsTo β†’ Cell* ## **Author:** *Y. Blaise*