This commit is contained in:
2025-02-16 21:11:07 +02:00
parent 87bbfc33d3
commit e8d7e6a1c4
253 changed files with 3879 additions and 72 deletions
+11
View File
@@ -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')