Total Complexity | 5 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Location extends Model |
||
9 | { |
||
10 | protected $table = 'locations'; |
||
11 | |||
12 | protected $fillable = [ |
||
13 | 'id', |
||
14 | 'name', |
||
15 | 'coordinate', |
||
16 | 'led_by', |
||
17 | 'capturable_id', |
||
18 | 'capturable_type', |
||
19 | ]; |
||
20 | |||
21 | /** |
||
22 | * Get the last known residence of the character. |
||
23 | */ |
||
24 | public function character() |
||
25 | { |
||
26 | return $this->hasOne(Character::class); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Get the last known residence of the character. |
||
31 | */ |
||
32 | public function leader() |
||
33 | { |
||
34 | return $this->belongsTo(Character::class, 'led_by'); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return HasMany |
||
39 | */ |
||
40 | public function inhabitants() |
||
41 | { |
||
42 | return $this->hasMany(Character::class, 'residence_id'); |
||
43 | } |
||
44 | |||
45 | public function capturable() |
||
46 | { |
||
47 | return $this->morphTo(); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Get all of the tags for the post. |
||
52 | */ |
||
53 | public function tags() |
||
57 | } |
||
58 | } |
||
59 |