Template   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 7
dl 0
loc 44
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNameAttribute() 0 4 1
A filesDir() 0 4 1
A getFileName() 0 6 1
A getImageDimensions() 0 4 1
1
<?php
2
3
namespace Faithgen\AppBuild\Models;
4
5
use Faithgen\AppBuild\Traits\HasManyBuildRequests;
6
use FaithGen\SDK\Models\UuidModel;
7
use FaithGen\SDK\Traits\ActiveTrait;
8
use FaithGen\SDK\Traits\Relationships\Morphs\CommentableTrait;
9
use FaithGen\SDK\Traits\Relationships\Morphs\ImageableTrait;
10
use FaithGen\SDK\Traits\StorageTrait;
11
use Illuminate\Support\Str;
12
13
class Template extends UuidModel
14
{
15
    use HasManyBuildRequests;
16
    use ImageableTrait;
17
    use CommentableTrait;
18
    use StorageTrait;
19
    use ActiveTrait;
20
21
    protected $table = 'fg_templates';
22
    protected $guarded = ['id'];
23
24
    protected $hidden = [
25
        'created_at',
26
        'updated_at',
27
    ];
28
29
    public function getNameAttribute($val)
30
    {
31
        return Str::title($val);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function filesDir()
38
    {
39
        return 'templates';
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getFileName()
46
    {
47
        return $this->images()
48
            ->pluck('name')
49
            ->toArray();
50
    }
51
52
    public function getImageDimensions()
53
    {
54
        return [0];
55
    }
56
}
57