Skip to content

MahbodHastam/laravel-iran-cities

Repository files navigation

Iran Cities for Laravel

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.

About

Iran provinces and cities for Laravel

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages