akaunting/modules/OfflinePayment/Database/Seeders/OfflinePaymentDatabaseSeeder.php

51 lines
1.0 KiB
PHP
Raw Normal View History

2017-09-14 22:21:00 +03:00
<?php
namespace Modules\OfflinePayment\Database\Seeders;
2017-09-14 22:21:00 +03:00
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class OfflinePaymentDatabaseSeeder extends Seeder
2017-09-14 22:21:00 +03:00
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->create();
Model::reguard();
}
private function create()
{
2019-02-22 16:14:13 +03:00
$company_id = $this->command->argument('company');
2017-09-14 22:21:00 +03:00
2019-02-22 16:14:13 +03:00
setting()->setExtraColumns(['company_id' => $company_id]);
$methods = [];
$methods[] = [
'code' => 'offlinepayment.cash.1',
2017-09-14 22:21:00 +03:00
'name' => 'Cash',
'customer' => '0',
2017-09-14 22:21:00 +03:00
'order' => '1',
'description' => null,
2019-02-22 16:14:13 +03:00
];
2017-09-14 22:21:00 +03:00
2019-02-22 16:14:13 +03:00
$methods[] = [
'code' => 'offlinepayment.bank_transfer.2',
2017-09-14 22:21:00 +03:00
'name' => 'Bank Transfer',
'customer' => '0',
2017-09-14 22:21:00 +03:00
'order' => '2',
'description' => null,
2019-02-22 16:14:13 +03:00
];
2017-09-14 22:21:00 +03:00
2019-02-22 16:14:13 +03:00
setting()->set('offlinepayment.methods', json_encode($methods));
2017-09-14 22:21:00 +03:00
}
}