[#2] content ratings

This commit is contained in:
2025-01-08 01:50:31 +02:00
parent 929954ebd9
commit 60ee3bb759
5 changed files with 112 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ContentRating extends Model
{
protected $fillable = [
'descriptors',
'iso_3166',
'rating',
];
protected $casts = [
'descriptors' => 'array',
];
}
+5
View File
@@ -65,4 +65,9 @@ class Show extends Model
{
return $this->belongsToMany(WatchProvider::class, 'show_watch_providers', 'show_id', 'watch_provider_id');
}
public function contentRatings()
{
return $this->belongsToMany(ContentRating::class, 'show_content_ratings', 'show_id', 'content_rating_id');
}
}