Skip to content

Commit

Permalink
Network has many Tvs
Browse files Browse the repository at this point in the history
  • Loading branch information
murdercode committed Jan 20, 2022
1 parent 5f144d1 commit 78e6538
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Models/Network.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use Astrotomic\Tmdb\Images\Logo;
use Astrotomic\Tmdb\Requests\Network\Details;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

/**
* @property int $id
Expand Down Expand Up @@ -55,6 +55,11 @@ class Network extends Model
'logo_path',
];

public function tvs(): BelongsToMany
{
return $this->belongsToMany(Tv::class, 'tv_network');
}

public function fillFromTmdb(array $data, ?string $locale = null): static
{
$this->fill([
Expand Down

0 comments on commit 78e6538

Please sign in to comment.