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