]> git.localhorst.tv Git - alttp.git/blob - app/Models/Episode.php
crew management
[alttp.git] / app / Models / Episode.php
1 <?php
2
3 namespace App\Models;
4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
7
8 class Episode extends Model
9 {
10
11         use HasFactory;
12
13         public function channels() {
14                 return $this->belongsToMany(Channel::class)
15                         ->using(Restream::class)
16                         ->withPivot('accept_comms', 'accept_tracker');
17         }
18
19         public function crew() {
20                 return $this->hasMany(EpisodeCrew::class);
21         }
22
23         public function event() {
24                 return $this->belongsTo(Event::class);
25         }
26
27         public function players() {
28                 return $this->hasMany(EpisodePlayer::class);
29         }
30
31         protected $casts = [
32                 'confirmed' => 'boolean',
33                 'start' => 'datetime',
34         ];
35
36         protected $hidden = [
37                 'created_at',
38                 'ext_id',
39                 'updated_at',
40         ];
41
42 }