Files

35 lines
715 B
PHP
Raw Permalink Normal View History

2024-12-30 02:28:58 +02:00
<?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');
}
}