5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
8 class Channel extends Model
12 public function getCurrentEpisode() {
13 return $this->episodes()
14 ->where('start', '<', now()->subMinutes(10))
15 ->orderBy('start', 'DESC')
19 public function crews() {
20 return $this->hasMany(ChannelCrew::class);
23 public function episodes() {
24 return $this->belongsToMany(Episode::class)
25 ->using(Restream::class)
26 ->withPivot('accept_comms', 'accept_tracker');
29 public function organization() {
30 return $this->belongsTo(Organization::class);
34 'chat_commands' => 'array',
35 'languages' => 'array',