Completed
Push — master ( ec6472...890182 )
by Ryan
02:11
created

DashboardSeeder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 15 1
1
<?php namespace Anomaly\DashboardModule\Seeder;
2
3
use Anomaly\DashboardModule\Dashboard\Contract\DashboardRepositoryInterface;
4
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
5
6
/**
7
 * Class DashboardSeeder
8
 *
9
 * @link          http://pyrocms.com/
10
 * @author        PyroCMS, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 * @package       Anomaly\DashboardModule\Seeder
13
 */
14
class DashboardSeeder extends Seeder
15
{
16
17
    /**
18
     * The dashboard repository.
19
     *
20
     * @var DashboardRepositoryInterface
21
     */
22
    protected $dashboards;
23
24
    /**
25
     * Create a new DashboardSeeder instance.
26
     *
27
     * @param $dashboards
28
     */
29
    public function __construct(DashboardRepositoryInterface $dashboards)
30
    {
31
        $this->dashboards = $dashboards;
32
    }
33
34
    /**
35
     * Run the seeder.
36
     */
37
    public function run()
38
    {
39
        $this->dashboards
40
            ->truncate()
41
            ->create(
42
                [
43
                    'en'     => [
44
                        'name'        => 'Home',
45
                        'description' => 'This is the default dashboard for PyroCMS.'
46
                    ],
47
                    'slug'   => 'home',
48
                    'layout' => '1'
49
                ]
50
            );
51
    }
52
}
53