[#1] added the credits part
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user