where('path', 'LIKE', "$path%"); } public function withMeta(User $user): static { return $this ->with('artist', 'album', 'album.artist') ->leftJoin('interactions', static function (JoinClause $join) use ($user): void { $join->on('interactions.song_id', '=', 'songs.id')->where('interactions.user_id', $user->id); }) ->join('albums', 'songs.album_id', '=', 'albums.id') ->join('artists', 'songs.artist_id', '=', 'artists.id') ->select( 'songs.*', 'albums.name', 'artists.name', 'interactions.liked', 'interactions.play_count' ); } public function hostedOnS3(): static { return $this->where('path', 'LIKE', 's3://%'); } }