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.
You can install the package via composer:
composer require mahbodhastam/laravel-iran-citiesAnd then publish the config file (optional):
php artisan vendor:publish --provider=MahbodHastam\\LaravelIranCities\\LaravelIranCitiesServiceProviderDon't forget to run the seeder:
- Add this line into the
runmethod of theDatabaseSeeder.phpfile:
$this->call(\MahbodHastam\LaravelIranCities\Database\Seeds\ProvincesAndCitiesSeeder::class);- Then run.
php artisan migrate --seedIt'll create two tables:
citiesandprovinces. You can change their names in the config file before migrating.
Use it like the other Laravel models.
All contributions are welcome.
composer testThe MIT License (MIT). Please see License File for more information.