]> git.localhorst.tv Git - alttp.git/blob - app/Models/Channel.php
8b5ff9007e2359c93bc105cdcd9b7e13fb1f73ce
[alttp.git] / app / Models / Channel.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 Channel extends Model
9 {
10         use HasFactory;
11
12         public function episodes() {
13                 return $this->belongsToMany(Episode::class)
14                         ->using(Restream::class)
15                         ->withPivot('accept_comms', 'accept_tracker');
16         }
17
18         public function organization() {
19                 return $this->belongsTo(Organization::class);
20         }
21
22         protected $casts = [
23                 'languages' => 'array',
24         ];
25
26         protected $hidden = [
27                 'created_at',
28                 'ext_id',
29                 'updated_at',
30         ];
31
32 }