Example 7 Let $P$ be a point outside the equilateral $\triangle A B C$, and $P A=3, P B=4, P C=5$. Find the side length of $\triangle A B C$.
Solution: As shown in Figure 10, construct a regular $\triangle A P D$ with $P A$ as one side, and connect $B D$. It is easy to see that $\triangle A B D \cong \triangle A C P$. Therefore, $B D = P C = 5$.

In $\triangle B P D$, given $P D = 3, P B = 4, B D = 5$, we know $\angle B P D = 90^{\circ}$. It is also known that $\angle A P B = 30^{\circ}$.
By the cosine rule, we have
$$
A B^{2} = 25 - 12 \sqrt{3}.
$$

Thus, $A B = \sqrt{25 - 12 \sqrt{3}}$, which means the side length of $\triangle A B C$ is $\sqrt{25 - 12 \sqrt{3}}$.