74 lines
1.7 KiB
PHP
74 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @property int $tmdb_id
|
|
*/
|
|
class Show extends Model
|
|
{
|
|
protected $fillable = [
|
|
'adult',
|
|
'backdrop_path',
|
|
'episode_run_time',
|
|
'first_air_date',
|
|
'homepage',
|
|
'tmdb_id',
|
|
'in_production',
|
|
'languages',
|
|
'last_air_date',
|
|
'name',
|
|
'slug',
|
|
'number_of_episodes',
|
|
'number_of_seasons',
|
|
'origin_country',
|
|
'original_language',
|
|
'original_name',
|
|
'overview',
|
|
'popularity',
|
|
'poster_path',
|
|
'status',
|
|
'tagline',
|
|
'type',
|
|
'vote_average',
|
|
'vote_count',
|
|
];
|
|
|
|
public function castList()
|
|
{
|
|
return $this->belongsToMany(Person::class, 'show_cast', 'show_id', 'person_id');
|
|
}
|
|
|
|
public function crewList()
|
|
{
|
|
return $this->belongsToMany(Person::class, 'show_crew', 'show_id', 'person_id');
|
|
}
|
|
|
|
public function images()
|
|
{
|
|
return $this->belongsToMany(Image::class, 'show_images', 'show_id', 'image_id');
|
|
}
|
|
|
|
public function videos()
|
|
{
|
|
return $this->belongsToMany(Video::class, 'show_videos', 'show_id', 'video_id');
|
|
}
|
|
|
|
public function keywords()
|
|
{
|
|
return $this->belongsToMany(Keyword::class, 'show_keywords', 'show_id', 'keyword_id');
|
|
}
|
|
|
|
public function watchProviders()
|
|
{
|
|
return $this->belongsToMany(WatchProvider::class, 'show_watch_providers', 'show_id', 'watch_provider_id');
|
|
}
|
|
|
|
public function contentRatings()
|
|
{
|
|
return $this->belongsToMany(ContentRating::class, 'show_content_ratings', 'show_id', 'content_rating_id');
|
|
}
|
|
}
|