Tag::houses()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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