DashboardSeeder::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
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
 */
13
class DashboardSeeder extends Seeder
14
{
15
16
    /**
17
     * The dashboard repository.
18
     *
19
     * @var DashboardRepositoryInterface
20
     */
21
    protected $dashboards;
22
23
    /**
24
     * Create a new DashboardSeeder instance.
25
     *
26
     * @param $dashboards
27
     */
28
    public function __construct(DashboardRepositoryInterface $dashboards)
29
    {
30
        $this->dashboards = $dashboards;
31
    }
32
33
    /**
34
     * Run the seeder.
35
     */
36
    public function run()
37
    {
38
        $this->dashboards
39
            ->truncate()
40
            ->create(
41
                [
42
                    'en'     => [
43
                        'name'        => 'Welcome',
44
                        'description' => 'This is the default dashboard for PyroCMS.',
45
                    ],
46
                    'slug'   => 'welcome',
47
                    'layout' => '24',
48
                ]
49
            );
50
    }
51
}
52