Tag   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
c 0
b 0
f 0
dl 0
loc 37
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A locations() 0 4 1
A houses() 0 4 1
A characters() 0 4 1
1
<?php
2
3
namespace TestSetup\Models;
4
5
use Illuminate\Database\Eloquent\SoftDeletes;
6
use LaravelFreelancerNL\Aranguent\Eloquent\Model;
7
8
class Tag extends Model
9
{
10
    use SoftDeletes;
11
12
    protected $table = 'tags';
13
14
    protected $fillable = [
15
        'id',
16
        'en',
17
        'de',
18
    ];
19
20
    /**
21
     * Get all of the characters that are assigned this tag.
22
     */
23
    public function characters()
24
    {
25
        return $this->morphedByMany(Character::class, 'taggable')
26
            ->using(Taggable::class);
27
    }
28
29
    /**
30
     * Get all of the locations that are assigned this tag.
31
     */
32
    public function locations()
33
    {
34
        return $this->morphedByMany(Location::class, 'taggable')
35
            ->using(Taggable::class);
36
    }
37
38
    /**
39
     * Get all of the locations that are assigned this tag.
40
     */
41
    public function houses()
42
    {
43
        return $this->morphedByMany(House::class, 'taggable')
44
            ->using(Taggable::class);
45
    }
46
}
47