Passed
Push — main ( d04005...d016cc )
by Garbuz
02:22
created

DatabaseSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 19
rs 9.9
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GarbuzIvan\LaravelGeneratorPackage\DataBase\Seeders;
6
7
use GarbuzIvan\LaravelGeneratorPackage\Models\DictOption;
8
use Illuminate\Database\Seeder;
9
use GarbuzIvan\LaravelGeneratorPackage\Models\Dict;
10
11
class DatabaseSeeder extends Seeder
12
{
13
    /**
14
     * Seed the application's database.
15
     *
16
     * @return void
17
     */
18
    public function run()
19
    {
20
        $dict = Dict::create([
21
            'name' => 'Статус',
22
            'type' => 'select',
23
        ]);
24
        $create = [
25
            [
26
                'name' => 'Активно',
27
                'json' => null,
28
                'dict_id' => $dict->id,
29
            ],
30
            [
31
                'name' => 'Не активно',
32
                'json' => null,
33
                'dict_id' => $dict->id,
34
            ],
35
        ];
36
        DictOption::insert($create);
37
    }
38
}
39