lots of progress
This commit is contained in:
@@ -76,6 +76,7 @@ class ItemToFetchJobs extends Model
|
||||
'item_id',
|
||||
'type',
|
||||
'remaining_jobs',
|
||||
'jobs',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
|
||||
@@ -6,6 +6,18 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MediaList extends Model
|
||||
{
|
||||
public const WATCHLIST = 'Watchlist';
|
||||
public const COLLECTION = 'Collection';
|
||||
public const WATCHED = 'Watched';
|
||||
public const LIKED = 'Liked';
|
||||
|
||||
public const SPECIAL_LISTS = [
|
||||
self::WATCHLIST,
|
||||
self::COLLECTION,
|
||||
self::WATCHED,
|
||||
self::LIKED,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'description',
|
||||
'favorites_count',
|
||||
@@ -15,6 +27,8 @@ class MediaList extends Model
|
||||
'iso_3166_1',
|
||||
'list_type',
|
||||
'name',
|
||||
'slug',
|
||||
'poster_path',
|
||||
'user_id',
|
||||
];
|
||||
}
|
||||
|
||||
+22
-1
@@ -28,6 +28,17 @@ class Movie extends Model
|
||||
'vote_count',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'release_date' => 'date'
|
||||
];
|
||||
|
||||
public function director()
|
||||
{
|
||||
return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id')
|
||||
->where('movie_cast.known_for_department', 'Directing')
|
||||
;
|
||||
}
|
||||
|
||||
public function collections()
|
||||
{
|
||||
return $this->belongsToMany(MovieCollection::class, 'movies_in_collection', 'movie_id', 'collection_id');
|
||||
@@ -40,7 +51,7 @@ class Movie extends Model
|
||||
|
||||
public function castList()
|
||||
{
|
||||
return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id');
|
||||
return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id')->withPivot('known_for_department', 'character', 'order');
|
||||
}
|
||||
|
||||
public function crewList()
|
||||
@@ -72,4 +83,14 @@ class Movie extends Model
|
||||
{
|
||||
return $this->belongsToMany(Video::class, 'movie_videos', 'movie_id', 'video_id');
|
||||
}
|
||||
|
||||
public function productionCompanies()
|
||||
{
|
||||
return $this->belongsToMany(ProductionCompany::class, 'movie_production_companies', 'movie_id', 'production_company_id');
|
||||
}
|
||||
|
||||
public function productionCountries()
|
||||
{
|
||||
return $this->belongsToMany(ProductionCountry::class, 'movie_production_countries', 'movie_id', 'production_country_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user