invoiceninja/database/seeds/GatewayTypesSeeder.php

28 lines
787 B
PHP
Raw Normal View History

2016-09-15 13:41:09 +03:00
<?php
use App\Models\GatewayType;
class GatewayTypesSeeder extends Seeder
{
public function run()
{
Eloquent::unguard();
$gateway_types = [
['alias' => 'credit_card', 'name' => 'Credit Card'],
['alias' => 'bank_transfer', 'name' => 'Bank Transfer'],
['alias' => 'paypal', 'name' => 'PayPal'],
['alias' => 'bitcoin', 'name' => 'Bitcoin'],
['alias' => 'dwolla', 'name' => 'Dwolla'],
2016-09-26 12:33:30 +03:00
['alias' => 'custom', 'name' => 'Custom'],
2016-09-15 13:41:09 +03:00
];
foreach ($gateway_types as $gateway_type) {
$record = GatewayType::where('name', '=', $gateway_type['name'])->first();
2017-01-30 21:40:43 +02:00
if (! $record) {
2016-09-15 13:41:09 +03:00
GatewayType::create($gateway_type);
}
}
}
}