progress
This commit is contained in:
@@ -58,6 +58,17 @@ class Movie extends Model
|
||||
return $rating ? $rating->rate : null;
|
||||
}
|
||||
|
||||
public function trailer()
|
||||
{
|
||||
return $this->belongsToMany(Video::class, 'movie_videos', 'movie_id', 'video_id')
|
||||
->where('videos.type', 'Trailer');
|
||||
}
|
||||
|
||||
public function externalIds()
|
||||
{
|
||||
return $this->hasOne(ExternalId::class, 'entity_id', 'id')->where('entity_type', ExternalId::TYPE_MOVIE);
|
||||
}
|
||||
|
||||
public function director()
|
||||
{
|
||||
return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id')
|
||||
|
||||
Reference in New Issue
Block a user