[#2] networks

This commit is contained in:
2025-01-08 02:15:22 +02:00
parent ddbfc95102
commit 300c2574ea
5 changed files with 116 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Network extends Model
{
protected $fillable = [
'tmdb_id',
'logo_path',
'name',
'slug',
'origin_country',
];
}
+5
View File
@@ -75,4 +75,9 @@ class Show extends Model
{
return $this->belongsToMany(Genre::class, 'show_genres', 'show_id', 'genre_id');
}
public function networks()
{
return $this->belongsToMany(Network::class, 'show_networks', 'show_id', 'network_id');
}
}