TaxRateTableSeeder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 17 1
1
<?php
2
3
use Illuminate\Database\Seeder;
4
use Illuminate\Database\Eloquent\Model;
5
use Hideyo\Ecommerce\Framework\Services\Shop\Entity\Shop as Shop;
6
use Hideyo\Ecommerce\Framework\Services\TaxRate\Entity\TaxRate as TaxRate;
7
8
9
class TaxRateTableSeeder extends Seeder
10
{
11
    public function run()
12
    {
13
        $taxRate = new TaxRate;
14
15
        DB::table($taxRate->getTable())->delete();
16
        $shop = Shop::where('title', '=', 'hideyo')->first();
17
18
        $taxRate->title = '21%';
19
        $taxRate->rate = '21';     
20
        $taxRate->shop_id = $shop->id;
21
        $taxRate->save();
22
23
        $taxRate2 = new TaxRate;
24
        $taxRate2->title = '6%';
25
        $taxRate2->rate = '6';     
26
        $taxRate2->shop_id = $shop->id;
27
        $taxRate2->save();
28
    }
29
}
30