whereNotIn('artists.id', [Artist::UNKNOWN_ID, Artist::VARIOUS_ID]); } public function accessibleBy(User $user): static { if (License::isCommunity()) { // With the Community license, all artists are accessible by all users. return $this; } return $this->join('songs', static function (JoinClause $join) use ($user): void { $join->on('artists.id', 'songs.artist_id') ->where(static function (JoinClause $query) use ($user): void { $query->where('songs.owner_id', $user->id) ->orWhere('songs.is_public', true); }); }); } }