Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class HouseAd extends Model |
||
9 | { |
||
10 | |||
11 | protected $guarded = []; |
||
12 | |||
13 | protected $hidden = ['game_id', 'media_portrait', 'media_landscape', 'confirmed_count', 'cancelled_count', 'start_at', 'end_at', 'created_at', 'updated_at']; |
||
14 | |||
15 | protected $appends = ['url_media_portrait', 'url_media_landscape', 'game']; |
||
16 | |||
17 | public function getUrlMediaPortraitAttribute() |
||
18 | { |
||
19 | return url('/media/'.$this->media_portrait); |
||
20 | } |
||
21 | |||
22 | public function getUrlMediaLandscapeAttribute() |
||
23 | { |
||
24 | return url('/media/'.$this->media_landscape); |
||
25 | } |
||
26 | |||
27 | public function game() |
||
28 | { |
||
29 | return $this->belongsTo(Game::class); |
||
30 | } |
||
31 | |||
32 | public function getGameAttribute() |
||
35 | } |
||
36 | |||
37 | } |
||
38 |