Download the PHP package hakanispirli/laravel-turkey-geo-database without Composer
On this page you can find all versions of the php package hakanispirli/laravel-turkey-geo-database. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hakanispirli/laravel-turkey-geo-database
More information about hakanispirli/laravel-turkey-geo-database
Files in hakanispirli/laravel-turkey-geo-database
Package laravel-turkey-geo-database
Short Description Laravel package for Turkish geographic data (cities, districts, neighborhoods) based on PTT database. Includes 81 cities, 900+ districts, and 50,000+ neighborhoods with postal codes.
License MIT
Homepage https://webmarka.com
Informations about the package laravel-turkey-geo-database
Laravel Turkey Geo Database
Complete Turkish geographic data package for Laravel applications. Get all Turkish cities, districts, and neighborhoods with postal codes in your database with just a few commands.
Installation
Install the package via Composer:
Setup Options
Choose the installation method that fits your needs:
Option 1: Standard Installation (Most Common)
Use this if you want the default database structure without modifications.
That's it! Your database now contains all Turkish geographic data.
Option 2: Custom Installation
Use this if you need to modify the database structure (add columns, change types, etc.).
💡 Pro Tip: Migration files are published with current timestamps, so they'll run after your existing migrations without conflicts.
⏱️ Seeding Time: Approximately 30-60 seconds to insert all data with progress tracking.
Basic Usage
Get All Cities
Get Districts for a City
Get Neighborhoods for a District
Search by Postal Code
Common Use Cases
1. City Dropdown for Forms
2. Dynamic District Loading (AJAX)
3. Get Full Address Details
Database Structure
cities
id- City ID (1-81)name- City name
districts
id- District IDcity_id- Belongs to cityname- District name
neighborhoods
id- Neighborhood IDdistrict_id- Belongs to districtname- Neighborhood namearea- Area/region informationpostal_code- PTT postal code
Configuration (Optional)
You can customize table names, seeding batch size, and other options:
Edit config/turkey-geo.php to customize:
- Table names
- Seeding batch size
- Progress display options
Advanced Features
Eager Loading Relationships
Validation Example
Caching for Performance
Troubleshooting
Seeder Class Not Found
Run composer autoload dump:
Data Files Not Found Error
Make sure you published the data files:
Verify files exist in database/data/turkey-geo/ directory.
Memory Issues During Seeding
Reduce batch size in config file:
Requirements
- PHP ^8.2
- Laravel ^11.0 or ^12.0
What's Included
- 81 Turkish Cities (İller)
- 900+ Districts (İlçeler)
- 50,000+ Neighborhoods (Mahalleler)
- PTT Postal Codes for all neighborhoods
- Optimized Performance with indexed database columns
- Eloquent Models with pre-configured relationships
- Progress Tracking during data seeding
Contributing
Contributions are welcome! Please submit a Pull Request.
Security
If you discover any security issues, please email [email protected].
Credits
- Hakan İspirli
- Webmarka
- PTT (Turkish Post) for official postal code data
License
The MIT License (MIT). See License File for more information.
Made with ❤️ by Webmarka
All versions of laravel-turkey-geo-database with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0