| Total Complexity | 7 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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() |
||
| 18 | } |
||
| 19 | |||
| 20 | public function tycoons() |
||
| 23 | } |
||
| 24 | |||
| 25 | public function worldTycoons() |
||
| 28 | } |
||
| 29 | |||
| 30 | public function online() |
||
| 31 | { |
||
| 32 | return $this->hasMany(WorldTycoon::class); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function investors() |
||
| 36 | { |
||
| 37 | return $this->hasMany(WorldTycoon::class); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function scopeOnlineCount($query) |
||
| 41 | { |
||
| 42 | return $query->withCount(['online' => function ($query) { |
||
| 43 | $query->online(); |
||
| 44 | }]); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function scopeInvestorCount($query) |
||
| 50 | } |
||
| 51 | } |
||
| 52 |