use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
class Artist extends Model
{
//
public function songs(): HasManyThrough
{
return $this->hasManyThrough(Song::class, Album::class);
}
//
}
Additional resources on HasManyThrough:
-
M H Hasib | dev.to
Published on
-
Brent | stitcher.io
Published on