SettingDatabaseSeeder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 11 1
1
<?php namespace Modules\Setting\Database\Seeders;
2
3
use Illuminate\Database\Eloquent\Model;
4
use Illuminate\Database\Seeder;
5
use Modules\Setting\Repositories\SettingRepository;
6
7
class SettingDatabaseSeeder extends Seeder
8
{
9
    /**
10
     * @var SettingRepository
11
     */
12
    private $setting;
13
14
    public function __construct(SettingRepository $setting)
15
    {
16
        $this->setting = $setting;
17
    }
18
19
    /**
20
     * Run the database seeds.
21
     *
22
     * @return void
23
     */
24
    public function run()
25
    {
26
        Model::unguard();
27
28
        $data = [
29
            'core::template' => 'Flatly',
30
            'core::locales' => ['en'],
31
        ];
32
33
        $this->setting->createOrUpdate($data);
34
    }
35
}
36