{"id":16466851,"url":"https://github.com/matriphe/laraciproid","last_synced_at":"2025-03-21T06:32:07.336Z","repository":{"id":62525108,"uuid":"43311564","full_name":"matriphe/laraciproid","owner":"matriphe","description":"Indonesia city and province data migration and seeder for Laravel.","archived":false,"fork":false,"pushed_at":"2017-12-31T01:27:01.000Z","size":39,"stargazers_count":23,"open_issues_count":0,"forks_count":18,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T22:08:28.202Z","etag":null,"topics":["city","hacktoberfest","indonesia","laravel","province","seeder"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matriphe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-28T16:08:25.000Z","updated_at":"2023-08-28T18:45:12.000Z","dependencies_parsed_at":"2022-11-02T10:31:31.814Z","dependency_job_id":null,"html_url":"https://github.com/matriphe/laraciproid","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Flaraciproid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Flaraciproid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Flaraciproid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Flaraciproid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matriphe","download_url":"https://codeload.github.com/matriphe/laraciproid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244751467,"owners_count":20504241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["city","hacktoberfest","indonesia","laravel","province","seeder"],"created_at":"2024-10-11T11:44:59.873Z","updated_at":"2025-03-21T06:32:07.071Z","avatar_url":"https://github.com/matriphe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laraciproid\n## Laravel City Province ID\n\nIndonesia city and province data migration and seeder for Laravel 5.x.\n\n### Installation\n\nUsing composer, run this command from your Laravel's project root directory:\n\n```bash\ncomposer require matriphe/laraciproid:~1.0\n```\n\n### Configuration\n\n#### Laravel 5.5\n\nNothing to do. Laraciproid will be loaded automatically.\n\n#### Laravel 5.1, 5.2, 5.3, and 5.4\n\nOpen `config/app.php` and add this line on autoloaded service providers section.\n\n```php\n'providers' =\u003e [\n\t...\n\tMatriphe\\Laraciproid\\ServiceProvider::class,\n\t...\n],\n```\n\n#### Laravel 5.0\n\nOpen `config/app.php` and add this line on autoloaded service providers section.\n\n```php\n'providers' =\u003e [\n        ...\n        'Matriphe\\Laraciproid\\ServiceProvider',\n        ...\n],\n```\n\n### Publish Vendor\n\n```bash\nphp artisan vendor:publish\n```\n\nOr if you want to more specific, and want to force the vendor publishing.\n\n```bash\nphp artisan vendor:publish --provider=\"Matriphe\\Laraciproid\\ServiceProvider\" --force\n```\n\nThis command will add these files to your project:\n\n * `config/laraciproid.php`, the configuration file containing tables name.\n * `database/migrations/2015_09_28_175100_create_city_province_tables`, the migration file.\n * `database/sql/city.sql`, SQL file for city seed.\n * `database/sql/province.sql`, SQL file for province seed.\n * `database/json/cities.json`, JSON file for cities seed.\n * `database/json/provinces.json`, JSON file for provinces seed.\n * `database/seeds/LaraciproidSeeder.php`, table seeder file, read the SQL data.\n * `app/Models/City.php`, city model file.\n * `app/Models/Province.php`, province model file.\n \n### Run Migration\n\n```bash\nphp artisan migrate\n```\n\n### Run Database Seeder\n\n```bash\nphp artisan db:seed --class=LaraciproidSeeder\n```\nYou can add this file to your `database/seeds/DatabaseSeeder.php` to make it auto loaded on seeding command.\n\n```php\npublic function run()\n{\n    Model::unguard();\n\n    $this-\u003ecall('LaraciproidSeeder');\n}\n```\n\n### Relationship\n\nProvince table has one to many relationship of City table.\n\n```php\n// Get all cities under DI Yogyakarta (province_id = 34)\n$cities = App\\Models\\Province::find(34)-\u003ecities;\n\nforeach ($cities as $city) {\n    // Do something\n}\n\n// Get province name of Bogor (city_id = 3271)\n$city = App\\Models\\City::find(3271);\n$province_name = $city-\u003eprovince-\u003eprovince_name;\n```\n\n\n### License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatriphe%2Flaraciproid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatriphe%2Flaraciproid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatriphe%2Flaraciproid/lists"}