35 lines
715 B
PHP
35 lines
715 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class Person extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'adult',
|
||
|
|
'also_known_as',
|
||
|
|
'tmdb_id',
|
||
|
|
'biography',
|
||
|
|
'birtday',
|
||
|
|
'deathday',
|
||
|
|
'gender',
|
||
|
|
'homepage',
|
||
|
|
'imdb_id',
|
||
|
|
'known_for_department',
|
||
|
|
'name',
|
||
|
|
'slug',
|
||
|
|
'place_of_birth',
|
||
|
|
'popularity',
|
||
|
|
'profile_path',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function moviesCast() {
|
||
|
|
return $this->belongsToMany(Movie::class, 'movie_cast', 'person_id', 'movie_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function moviesCrew() {
|
||
|
|
return $this->belongsToMany(Movie::class, 'movie_crew', 'person_id', 'movie_id');
|
||
|
|
}
|
||
|
|
}
|