SeedPdfTemplatesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 16 2
1
<?php namespace VojtaSvoboda\UserExportPdf\Updates;
2
3
use File;
4
use Renatio\DynamicPDF\Models\Layout;
5
use Renatio\DynamicPDF\Models\Template;
6
use Schema;
7
use Seeder;
8
9
class SeedPdfTemplatesTable extends Seeder
10
{
11
    public function run()
12
    {
13
        if (!Schema::hasTable('renatio_dynamicpdf_pdf_templates')) {
14
            return false;
15
        }
16
17
        $layout = Layout::where('code', 'rainlab::user')->first();
18
19
        Template::create([
20
            'title' => 'User profile',
21
            'description' => "User's PDF card template",
22
            'layout' => $layout,
23
            'code' => 'rainlab::user',
24
            'content_html' => File::get(__DIR__ . '/templates/user.htm'),
25
        ]);
26
    }
27
}
28