21 lines
402 B
PHP
21 lines
402 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MovieGenre extends Model
|
|
{
|
|
protected $table = 'genres';
|
|
protected $primaryKey = 'genre_id';
|
|
public $timestamps = false;
|
|
protected $fillable = [
|
|
'genre_name',
|
|
];
|
|
|
|
public function movies()
|
|
{
|
|
return $this->belongsToMany(Movie::class, 'movie_genres', 'genre_id', 'movie_id');
|
|
}
|
|
|
|
}
|