PageDatabaseSeeder::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 20
rs 9.4286
cc 1
eloc 11
nc 1
nop 0
1
<?php namespace Modules\Page\Database\Seeders;
2
3
use Illuminate\Database\Eloquent\Model;
4
use Illuminate\Database\Seeder;
5
use Modules\Page\Repositories\PageRepository;
6
7
class PageDatabaseSeeder extends Seeder
8
{
9
    /**
10
     * @var PageRepository
11
     */
12
    private $page;
13
14
    public function __construct(PageRepository $page)
15
    {
16
        $this->page = $page;
17
    }
18
19
    public function run()
20
    {
21
        Model::unguard();
22
23
        $data = [
24
            'template' => 'home',
25
            'is_home' => 1,
26
            'en' => [
27
                'title' => 'Home page',
28
                'slug' => 'home',
29
                'body' => '<p><strong>You made it!</strong></p>
30
<p>You&#39;ve installed AsgardCMS and are ready to proceed to the <a href="/en/backend">administration area</a>.</p>
31
<h2>What&#39;s next ?</h2>
32
<p>Learn how you can develop modules for AsgardCMS by reading our <a href="https://github.com/AsgardCms/Documentation">documentation</a>.</p>
33
',
34
                'meta_title' => 'Home page',
35
            ],
36
        ];
37
        $this->page->create($data);
38
    }
39
}
40