mahbodhastam / laravel-iran-cities
Iran provinces and cities for Laravel.
1.0.2
2025-03-30 08:51 UTC
Requires
- php: ^8.2
- cviebrock/eloquent-sluggable: ^12.0
- illuminate/support: ^12.0
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
README
I spent the day searching for an existing package providing a list of cities in Iran, but I couldn't find one. As a result, I created this package. The helper functions and core logic are based on the work of SanjabTeam, but their original repository appears to be archived.
Installation
You can install the package via composer:
composer require mahbodhastam/laravel-iran-cities
And then publish the config file (optional):
php artisan vendor:publish --provider=MahbodHastam\\LaravelIranCities\\LaravelIranCitiesServiceProvider
Don't forget to run the seeder:
- Add this line into the
run
method of theDatabaseSeeder.php
file:
$this->call(\MahbodHastam\LaravelIranCities\Database\Seeds\ProvincesAndCitiesSeeder::class);
- Then run.
php artisan migrate --seed
It'll create two tables:
cities
andprovinces
. You can change their names in the config file before migrating.
Usage
Use it like the other Laravel models.
Contributing
All contributions are welcome.
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.