This commit is contained in:
2024-12-30 22:41:34 +02:00
parent 6abcbe2a84
commit e60058c1c0
11 changed files with 264 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MediaList extends Model
{
protected $fillable = [
'description',
'favorites_count',
'tmdb_id',
'item_count',
'iso_639_1',
'iso_3166_1',
'list_type',
'name',
'poster_path',
];
}
+15
View File
@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MediaListItem extends Model
{
protected $fillable = [
'media_list_id',
'item_id',
'item_type',
'tmdb_id',
];
}
+7
View File
@@ -19,8 +19,10 @@ class User extends Authenticatable
*/
protected $fillable = [
'name',
'slug',
'email',
'password',
'is_dummy_account',
];
/**
@@ -45,4 +47,9 @@ class User extends Authenticatable
'password' => 'hashed',
];
}
public function mediaLists()
{
return $this->belongsToMany(MediaList::class, 'user_media_lists', 'user_id', 'media_list_id');
}
}