movie-night-api/app/Models/MovieList.php

27 lines
509 B
PHP
Raw Normal View History

2026-02-18 00:15:02 -06:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class MovieList extends Model
{
protected $fillable = [
'name',
'is_public',
'owner',
'slug',
];
public function movies(): BelongsToMany
{
return $this->belongsToMany(Movie::class);
}
public function collaborators(): BelongsToMany
{
return $this->belongsToMany(User::class, 'movie_list_user');
}
2026-02-18 00:15:02 -06:00
}