Planck's law comes about from the following ingredients.
1) The mode density per unit volume in a cavity is $8\pi\nu^2/c^3$.
2) Within each mode, assume Boltzmann statistics i.e the probability of having an energy $E$ is given by $p(E) \propto e^{-E/kT}$
3) Ask that the energies $E$ be discretized as $nh\nu$ instead of continuous. Essentially, the difference between doing $\int E e^{-E/kT}dE$ and the sum $\sum_n E_n e^{-E_n/kT}$, where $E_n = nh\nu$ gives Planck's law.
$$I = \frac{8\pi\nu^2}{c^3}\frac{h\nu}{e^{h\nu/kT} - 1} \, .$$
So far, it's a nice trick to go to the discrete sum but that's all that was done. There is no sense in which the particles are indistinguishable etc.
What is the correct modern way of seeing this result? I assume the starting point is that we have an ideal gas of photons inside a blackbody cavity and they follow statistics that yield $p(E) =\frac{1}{e^{E/kT} - 1}$ but how exactly does one go from there to Planck's law?