5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
8 class EpisodePlayer extends Model
12 public function episode() {
13 return $this->belongsTo(Episode::class);
16 public function user() {
17 return $this->belongsTo(User::class);
20 public function getName() {
21 if (!empty($this->name_override)) {
22 return $this->name_override;
25 if (!empty($this->user->nickname)) {
26 return $this->user->nickname;
28 if (!empty($this->user->username)) {
29 return $this->user->username;
35 public function getStreamLink() {
36 if (!empty($this->stream_override)) {
37 return $this->stream_override;
39 if ($this->user && !empty($this->user->stream_link)) {
40 return $this->user->stream_link;
46 'user_id' => 'string',