return $this->belongsTo(User::class);
}
+ public function getName() {
+ if (!empty($this->name_override)) {
+ return $this->name_override;
+ }
+ if ($this->user) {
+ if (!empty($this->user->nickname)) {
+ return $this->user->nickname;
+ }
+ if (!empty($this->user->username)) {
+ return $this->user->username;
+ }
+ }
+ return '';
+ }
+
+ public function getStreamLink() {
+ if (!empty($this->stream_override)) {
+ return $this->stream_override;
+ }
+ if ($this->user && !empty($this->user->stream_link)) {
+ return $this->user->stream_link;
+ }
+ return '';
+ }
+
+ protected $casts = [
+ 'user_id' => 'string',
+ ];
+
protected $hidden = [
'created_at',
+ 'ext_id',
'updated_at',
];