StatusesSeeder::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
use agoalofalife\postman\Models\Status;
4
use Illuminate\Database\Seeder;
5
6
/**
7
 * Class StatusesSeeder
8
 */
9
class StatusesSeeder extends Seeder
10
{
11
    /**
12
     * Auto generated seed file.
13
     *
14
     * @return void
15
     */
16
    public function run() : void
17
    {
18
        foreach (trans('postman::statuses') as $status) {
19
            Status::firstOrCreate([
20
                'name' => $status['name'],
21
                'description' => $status['description'],
22
                'color_rgb' => $status['color_rgb'],
23
                Status::COLUMN_UNIQUE_NAME => $status['unique_name'],
24
            ]);
25
        }
26
    }
27
}
28