Add Malagasy Ariary currency

This commit is contained in:
David Bomba 2023-10-10 19:32:12 +11:00
parent f33e94129b
commit b1f61e1fbe
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,39 @@
<?php
use App\Models\Currency;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$cur = Currency::find(119);
if(!$cur) {
$cur = new \App\Models\Currency();
$cur->id = 119;
$cur->code = 'MGA';
$cur->name = 'Malagasy ariary';
$cur->symbol = 'Ar';
$cur->thousand_separator = ',';
$cur->decimal_separator = '.';
$cur->precision = 0;
$cur->save();
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@ -141,6 +141,7 @@ class CurrenciesSeeder extends Seeder
['id' => 116, 'name' => 'Silver Troy Ounce', 'code' => 'XAG', 'symbol' => 'XAG', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['id' => 117, 'name' => 'Gold Troy Ounce', 'code' => 'XAU', 'symbol' => 'XAU', 'precision' => '3', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['id' => 118, 'name' => 'Nicaraguan Córdoba', 'code' => 'NIO', 'symbol' => 'C$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['id' => 119, 'name' => 'Malagasy ariary', 'code' => 'MGA', 'symbol' => 'AR', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
];
foreach ($currencies as $currency) {