mahbodhastam/laravel-iran-cities

Iran provinces and cities for Laravel.

1.0.2 2025-03-30 08:51 UTC

This package is auto-updated.

Last update: 2025-03-30 08:52:38 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

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:

  1. Add this line into the run method of the DatabaseSeeder.php file:
$this->call(\MahbodHastam\LaravelIranCities\Database\Seeds\ProvincesAndCitiesSeeder::class);
  1. Then run.
php artisan migrate --seed

It'll create two tables: cities and provinces. 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.