5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
8 class Episode extends Model
13 public function channels() {
14 return $this->belongsToMany(Channel::class)
15 ->using(Restream::class)
16 ->withPivot('accept_comms', 'accept_tracker');
19 public function crew() {
20 return $this->hasMany(EpisodeCrew::class);
23 public function confirmedCrew() {
24 return $this->crew()->where('confirmed', true);
27 public function confirmedCrewOfChannel(Channel $channel) {
28 return $this->confirmedCrew()->where('channel_id', '=', $channel->id);
31 public function event() {
32 return $this->belongsTo(Event::class);
35 public function players() {
36 return $this->hasMany(EpisodePlayer::class);
40 'confirmed' => 'boolean',
41 'start' => 'datetime',