[#2] content ratings
This commit is contained in:
@@ -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',
|
||||
];
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user