X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FEpisode.php;h=4b8a96a53e2061f527db4d88d089ac411f90e1d9;hb=07a88747f8a252b41b739185fcb68bdee3a60f9a;hp=2084a32b53f67c53ba0df0720c0f3d0c597973c8;hpb=5a575dc29f3af10f1d8e142ff9e1c6ccdfa3b075;p=alttp.git diff --git a/app/Models/Episode.php b/app/Models/Episode.php index 2084a32..4b8a96a 100644 --- a/app/Models/Episode.php +++ b/app/Models/Episode.php @@ -20,6 +20,14 @@ class Episode extends Model return $this->hasMany(EpisodeCrew::class); } + public function confirmedCrew() { + return $this->crew()->where('confirmed', true); + } + + public function confirmedCrewOfChannel(Channel $channel) { + return $this->confirmedCrew()->where('channel_id', '=', $channel->id); + } + public function event() { return $this->belongsTo(Event::class); } @@ -35,7 +43,6 @@ class Episode extends Model protected $hidden = [ 'created_at', - 'ext_id', 'updated_at', ];