Example of HasManyThrough in koel/koel

File app/Models/Artist.php (link to Github)
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: