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 episodes() {
20 return $this->belongsToMany(Episode::class)
21 ->using(Restream::class)
22 ->withPivot('accept_comms', 'accept_tracker');
25 public function organization() {
26 return $this->belongsTo(Organization::class);
30 'chat_commands' => 'array',
31 'languages' => 'array',