Blame view

modules/OfflinePayment/Database/Seeders/OfflinePaymentDatabaseSeeder.php 973 Bytes
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  <?php
  
  namespace Modules\OfflinePayment\Database\Seeders;
  
  use Illuminate\Database\Seeder;
  use Illuminate\Database\Eloquent\Model;
  use Setting;
  
  class OfflinePaymentDatabaseSeeder extends Seeder
  {
      /**
       * Run the database seeds.
       *
       * @return void
       */
      public function run()
      {
          Model::unguard();
  
          $this->create();
  
          Model::reguard();
      }
  
      private function create()
      {
          $methods = array();
  
          $methods[] = array(
              'code' => 'offlinepayment.cash.1',
              'name' => 'Cash',
              'customer' => '0',
              'order' => '1',
              'description' => null,
          );
  
          $methods[] = array(
              'code' => 'offlinepayment.bank_transfer.2',
              'name' => 'Bank Transfer',
              'customer' => '0',
              'order' => '2',
              'description' => null,
          );
  
          Setting::set('offlinepayment.methods', json_encode($methods));
      }
  }