Barcelona have secured their first La Liga title since 2019 thanks to a 4-2 win over inner-city rivals Espanyol on Sunday.