cineflex/app/Models/MovieGenre.php

22 lines
402 B
PHP
Raw Normal View History

2022-11-23 09:32:34 +01:00
<?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');
}
}