ferdirn/laravel-id-cities
Laravel package to create and seed an Indonesian cities (kota/kabupaten) table. Includes artisan commands to generate migrations and a seeder, plus optional config for table naming. Provides Cities service provider, facade, and ready-to-use city data.
cities table. If the app already uses a similar structure (e.g., countries, provinces), integration is straightforward. Mismatched schemas (e.g., NoSQL) would require significant adaptation.cities) could cause issues if the app uses pluralization (e.g., city → City model).dev-master and installation steps). Laravel 8/9/10 compatibility is untested.City model with fields like id, name, province_id. Schema mismatches (e.g., additional columns like latitude/longitude) would need manual alignment.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Schema Conflicts | High | Pre-integration schema audit; use migrations to align tables. |
| Laravel Version Gap | Medium | Test compatibility with Laravel 8+; consider forking if critical. |
| Data Staleness | Medium | Implement a fallback mechanism (e.g., cache local copies) if updates are needed. |
| Vendor Lock-in | Low | Minimal risk; data can be exported/imported. |
| Performance | Low | Static data; negligible impact unless querying all cities frequently. |
cities table schema changes?cities table: Document current schema, data sources, and dependencies.composer.json:
composer require ferdirn/laravel-id-cities:dev-master
config/app.php (as per README).php artisan vendor:publish --provider="Ferdirn\Cities\CitiesServiceProvider" --tag="migrations"
cities table and let the package seed it.
php artisan migrate:fresh --seed
Cities facade (e.g., Cities::find(1)).ferdirn packages (laravel-id-countries, laravel-id-provinces) if all are installed.Cities facade.dev-master branch implies unstable updates.1.0.0) if stability is critical.ferdirn).// Example: Backup cities to a custom table
$cities = \Ferdirn\Cities\Models\City::all();
DB::table('custom_cities')->upsert($cities->toArray());
Cities::all() not found).Cities::where('province_id', 1)->get()).php artisan db:seed --class=CitiesTableSeeder --force
Cache::remember('all_cities', now()->addDays(7), function () {
return \Ferdirn\Cities\Models\City::all();
});
How can I help you explore Laravel packages today?