2017-09-14 22:21:00 +03:00
|
|
|
<?php
|
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
namespace Modules\OfflinePayments\Database\Seeders;
|
2017-09-14 22:21:00 +03:00
|
|
|
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2019-11-16 10:21:14 +03:00
|
|
|
use Setting;
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
class OfflinePaymentsDatabaseSeeder 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-11-16 10:21:14 +03:00
|
|
|
$methods = array();
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
$methods[] = array(
|
|
|
|
'code' => 'offline-payments.cash.1',
|
2017-09-14 22:21:00 +03:00
|
|
|
'name' => 'Cash',
|
2017-11-19 02:52:01 +03:00
|
|
|
'customer' => '0',
|
2017-09-14 22:21:00 +03:00
|
|
|
'order' => '1',
|
|
|
|
'description' => null,
|
2019-11-16 10:21:14 +03:00
|
|
|
);
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
$methods[] = array(
|
|
|
|
'code' => 'offline-payments.bank_transfer.2',
|
2017-09-14 22:21:00 +03:00
|
|
|
'name' => 'Bank Transfer',
|
2017-11-19 02:52:01 +03:00
|
|
|
'customer' => '0',
|
2017-09-14 22:21:00 +03:00
|
|
|
'order' => '2',
|
|
|
|
'description' => null,
|
2019-11-16 10:21:14 +03:00
|
|
|
);
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
Setting::set('offline-payments.methods', json_encode($methods));
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
}
|