app\models\Song::getArtistAttribute PHP Method

getArtistAttribute() public method

If it's part of a compilation, that would be the contributing artist. Otherwise, it's the album artist.
public getArtistAttribute ( ) : Artist
return Artist
    public function getArtistAttribute()
    {
        return $this->contributing_artist_id ? $this->contributingArtist : $this->album->artist;
    }