invoiceninja/database/seeds/GatewayTypesSeeder.php
David Bomba 4bc92a7aa1
Stub GMail Driver (#3099)
* fix for blank client settings

* Force all custom fields to strings

* Fixes for bulk actions

* Fixes for company POST route..

* Change text from Bitcoin to CRYPTO

* Implement default_gateway_type_id in transformer

* use scopes for company filtering

* Implement validation for portal_domain

* Add Google API client

* Add activities to company transformer
2019-11-27 20:47:59 +11:00

39 lines
1.3 KiB
PHP

<?php
use App\Models\GatewayType;
use Illuminate\Database\Seeder;
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' => 'crypto', 'name' => 'Crypto'],
['alias' => 'dwolla', 'name' => 'Dwolla'],
['alias' => 'custom1', 'name' => 'Custom'],
['alias' => 'alipay', 'name' => 'Alipay'],
['alias' => 'sofort', 'name' => 'Sofort'],
['alias' => 'sepa', 'name' => 'SEPA'],
['alias' => 'gocardless', 'name' => 'GoCardless'],
['alias' => 'apple_pay', 'name' => 'Apple Pay'],
['alias' => 'custom2', 'name' => 'Custom'],
['alias' => 'custom3', 'name' => 'Custom'],
];
foreach ($gateway_types as $gateway_type) {
$record = GatewayType::where('alias', '=', $gateway_type['alias'])->first();
if ($record) {
$record->fill($gateway_type);
$record->save();
} else {
GatewayType::create($gateway_type);
}
}
}
}