Merge remote-tracking branch 'origin/master'

This commit is contained in:
Daeng Deni Mardaeni
2025-03-13 08:57:58 +07:00
3 changed files with 83488 additions and 83471 deletions

View File

@@ -23,7 +23,9 @@
public function data() public function data()
{ {
return [
// return = [
$originalData = [
['province_code' => 11, 'code' => '11.01', 'name' => 'KAB. ACEH SELATAN'], ['province_code' => 11, 'code' => '11.01', 'name' => 'KAB. ACEH SELATAN'],
['province_code' => 11, 'code' => '11.02', 'name' => 'KAB. ACEH TENGGARA'], ['province_code' => 11, 'code' => '11.02', 'name' => 'KAB. ACEH TENGGARA'],
['province_code' => 11, 'code' => '11.03', 'name' => 'KAB. ACEH TIMUR'], ['province_code' => 11, 'code' => '11.03', 'name' => 'KAB. ACEH TIMUR'],
@@ -540,5 +542,15 @@
['province_code' => 92, 'code' => '92.71', 'name' => 'KOTA SORONG'], ['province_code' => 92, 'code' => '92.71', 'name' => 'KOTA SORONG'],
]; ];
$formattedData = array_map(function ($item) {
$item['name'] = ucwords(strtolower($item['name']));
return $item;
}, $originalData);
return $formattedData;
} }
} }

View File

@@ -4,6 +4,7 @@ namespace Modules\Location\Database\Seeders;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class VillageSeeder extends Seeder class VillageSeeder extends Seeder
{ {
@@ -12,8 +13,12 @@ class VillageSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
DB::unprepared(file_get_contents(__DIR__ . '/villages.sql'));
try {
DB::unprepared(file_get_contents(__DIR__ . '/villages.sql'));
} catch (\Exception $e) {
Log::error('Seeder Error: ' . $e->getMessage());
throw $e;
}
} }
} }

File diff suppressed because it is too large Load Diff