Completed
Push — master ( a53d7f...d34d58 )
by Ron
01:38
created

World::tycoons()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Starpeace\Models\Eloquent\Common;
4
5
use Starpeace\Models\Eloquent\BaseModel;
6
7
class World extends BaseModel
8
{
9
    protected $table = 'worlds';
10
11
    protected $fillable = [ 'galaxy_id', 'map_id', 'name', 'display_name', 'use_whitelist', 'use_blacklist' ];
12
13
    protected $dates = [ 'created_at', 'updated_at' ];
14
15
    public function galaxy()
16
    {
17
        return $this->belongsTo(Galaxy::class, 'id', 'galaxy_id');
18
    }
19
20
    public function tycoons()
21
    {
22
        return $this->hasManyThrough(Tycoon::class, WorldTycoon::class, 'tycoon_id', 'world_id');
23
    }
24
}