5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
8 class EpisodeCrew extends Model
12 public function channel() {
13 return $this->belongsTo(Channel::class);
16 public function episode() {
17 return $this->belongsTo(Episode::class);
20 public function user() {
21 return $this->belongsTo(User::class);
24 public function getName() {
25 if (!empty($this->name_override)) {
26 return $this->name_override;
29 if (!empty($this->user->nickname)) {
30 return $this->user->nickname;
32 if (!empty($this->user->username)) {
33 return $this->user->username;
39 public function getStreamLink() {
40 if (!empty($this->stream_override)) {
41 return $this->stream_override;
43 if ($this->user && !empty($this->user->stream_link)) {
44 return $this->user->stream_link;
50 'confirmed' => 'boolean',
51 'user_id' => 'string',
54 protected $fillable = [