lots of progress
This commit is contained in:
@@ -12,4 +12,13 @@ class MediaListItem extends Model
|
||||
'item_type',
|
||||
'tmdb_id',
|
||||
];
|
||||
|
||||
public function item()
|
||||
{
|
||||
if ($this->item_type == 'movie') {
|
||||
return $this->hasOne(Movie::class, 'id', 'item_id');
|
||||
}
|
||||
|
||||
return $this->hasOne(Show::class, 'id', 'item_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user