Image   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
eloc 5
c 3
b 0
f 1
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCaptionAttribute() 0 3 1
A imageable() 0 3 1
1
<?php
2
3
namespace FaithGen\SDK\Models;
4
5
use FaithGen\SDK\Traits\Relationships\Morphs\CommentableTrait;
6
7
class Image extends UuidModel
8
{
9
    use CommentableTrait;
10
11
    protected $table = 'fg_images';
12
13
    /**
14
     * This relates all models to the image.
15
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
16
     */
17
    public function imageable()
18
    {
19
        return $this->morphTo();
20
    }
21
22
    public function getCaptionAttribute($val)
23
    {
24
        return ucfirst($val);
25
    }
26
}
27