invoiceninja/database/migrations/2022_16_12_54687_add_stripe_bacs.php
2022-12-16 11:02:49 +01:00

40 lines
836 B
PHP

<?php
use App\Models\GatewayType;
use App\Models\PaymentType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$pt = PaymentType::find(49);
if(!$pt)
{
$type = new PaymentType();
$type->id = 49;
$type->name = 'BACS';
$type->gateway_type_id = GatewayType::BACS;
$type->save();
}
$gt = GatewayType::find(24);
if(!$gt)
{
$type = new GatewayType();
$type->id = 24;
$type->alias = 'bacs';
$type->name = 'BACS';
$type->save();
}
}
};