41 lines
824 B
PHP
41 lines
824 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class Movie extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'tmdb_id',
|
||
|
|
'adult',
|
||
|
|
'runtime',
|
||
|
|
'backdrop_path',
|
||
|
|
'budget',
|
||
|
|
'revenue',
|
||
|
|
'homepage',
|
||
|
|
'imdb_id',
|
||
|
|
'status',
|
||
|
|
'original_language',
|
||
|
|
'original_title',
|
||
|
|
'title',
|
||
|
|
'slug',
|
||
|
|
'overview',
|
||
|
|
'tagline',
|
||
|
|
'poster_path',
|
||
|
|
'release_date',
|
||
|
|
'vote_average',
|
||
|
|
'vote_count',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function collections()
|
||
|
|
{
|
||
|
|
return $this->belongsToMany(MovieCollection::class, 'movies_in_collection', 'movie_id', 'collection_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function genres()
|
||
|
|
{
|
||
|
|
return $this->belongsToMany(Genre::class, 'movie_genres', 'movie_id', 'genre_id');
|
||
|
|
}
|
||
|
|
}
|