From 2341f202bf78ab5f4fa32059d65f25e2611be74c Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Sat, 26 Apr 2025 19:36:43 +0700 Subject: [PATCH] feat(currency): tambahkan seeder untuk data mata uang - Menambahkan seeder baru untuk mengisi tabel currencies dengan data mata uang. - Memperbarui daftar mata uang dengan simbol dan detail lainnya. - Menggunakan Carbon untuk timestamp created_at dan updated_at. --- database/seeders/CurrencySeeder.php | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 database/seeders/CurrencySeeder.php diff --git a/database/seeders/CurrencySeeder.php b/database/seeders/CurrencySeeder.php new file mode 100644 index 0000000..4a634a5 --- /dev/null +++ b/database/seeders/CurrencySeeder.php @@ -0,0 +1,64 @@ + 'USD', 'name' => 'United States Dollar', 'symbol' => '$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'GBP', 'name' => 'British Pound Sterling', 'symbol' => '£', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'JPY', 'name' => 'Japanese Yen', 'symbol' => '¥', 'decimal_places' => 0, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'AUD', 'name' => 'Australian Dollar', 'symbol' => 'A$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'CAD', 'name' => 'Canadian Dollar', 'symbol' => 'C$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'CHF', 'name' => 'Swiss Franc', 'symbol' => 'CHF', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'CNY', 'name' => 'Chinese Yuan', 'symbol' => '¥', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'SEK', 'name' => 'Swedish Krona', 'symbol' => 'kr', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'NZD', 'name' => 'New Zealand Dollar', 'symbol' => 'NZ$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'MXN', 'name' => 'Mexican Peso', 'symbol' => '$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'SGD', 'name' => 'Singapore Dollar', 'symbol' => 'S$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'HKD', 'name' => 'Hong Kong Dollar', 'symbol' => 'HK$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'NOK', 'name' => 'Norwegian Krone', 'symbol' => 'kr', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'KRW', 'name' => 'South Korean Won', 'symbol' => '₩', 'decimal_places' => 0, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'TRY', 'name' => 'Turkish Lira', 'symbol' => '₺', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'RUB', 'name' => 'Russian Ruble', 'symbol' => '₽', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'INR', 'name' => 'Indian Rupee', 'symbol' => '₹', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'BRL', 'name' => 'Brazilian Real', 'symbol' => 'R$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'ZAR', 'name' => 'South African Rand', 'symbol' => 'R', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'IDR', 'name' => 'Indonesian Rupiah', 'symbol' => 'Rp', 'decimal_places' => 0, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'MYR', 'name' => 'Malaysian Ringgit', 'symbol' => 'RM', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'PHP', 'name' => 'Philippine Peso', 'symbol' => '₱', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'THB', 'name' => 'Thai Baht', 'symbol' => '฿', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'PLN', 'name' => 'Polish Złoty', 'symbol' => 'zł', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'DKK', 'name' => 'Danish Krone', 'symbol' => 'kr', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'AED', 'name' => 'United Arab Emirates Dirham', 'symbol' => 'د.إ', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'ARS', 'name' => 'Argentine Peso', 'symbol' => '$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'CLP', 'name' => 'Chilean Peso', 'symbol' => '$', 'decimal_places' => 0, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'EGP', 'name' => 'Egyptian Pound', 'symbol' => 'E£', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'KWD', 'name' => 'Kuwaiti Dinar', 'symbol' => 'د.ك', 'decimal_places' => 3, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'NGN', 'name' => 'Nigerian Naira', 'symbol' => '₦', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'QAR', 'name' => 'Qatari Riyal', 'symbol' => 'ر.ق', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'SAR', 'name' => 'Saudi Riyal', 'symbol' => 'ر.س', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'VND', 'name' => 'Vietnamese Dong', 'symbol' => '₫', 'decimal_places' => 0, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'BDT', 'name' => 'Bangladeshi Taka', 'symbol' => '৳', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'ILS', 'name' => 'Israeli New Shekel', 'symbol' => '₪', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'COP', 'name' => 'Colombian Peso', 'symbol' => '$', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'PEN', 'name' => 'Peruvian Sol', 'symbol' => 'S/', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ['code' => 'PKR', 'name' => 'Pakistani Rupee', 'symbol' => '₨', 'decimal_places' => 2, 'status' => true, 'created_at' => $now, 'updated_at' => $now], + ]; + + DB::table('currencies')->insert($currencies); + } + }