Add new guilder currency

This commit is contained in:
David Bomba
2025-04-30 08:57:33 +10:00
parent e354d27091
commit 9d39af240c
3 changed files with 158 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
<?php
use App\Models\Currency;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Eloquent\Model;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Currency::find(143)){
Model::unguard();
$currency = ['id' => 143, 'name' => 'Caribbean guilder', 'code' => 'XCG', 'symbol' => 'Cg', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','];
Currency::create($currency);
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@@ -165,7 +165,7 @@ class CurrenciesSeeder extends Seeder
['id' => 140, 'name' => 'Turkmenistani Manat', 'code' => 'TMT', 'symbol' => 'T', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['id' => 141, 'name' => 'Uzbekistani Som', 'code' => 'UZS', 'symbol' => 'so\'m', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['id' => 142, 'name' => 'Samoan Tala', 'code' => 'WST', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['id' => 143, 'name' => 'Caribbean guilder', 'code' => 'XCG', 'symbol' => 'Cg', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
];
foreach ($currencies as $currency) {