Active record sort by joined table column

I couldn’t work out how to achieve this. I’m probably missing something simple. My current code is this:

        $players = Player::find()


                    ->orderBy('first_name', '') 


        // Player drop down

        $playerMap = ArrayHelper::map($players, 'player_id', function ($players, $defaultValue) {

                                                                return $players->getFullName();

                                                            }, ''); 

I am trying to generate a dropdown menu that has headings, it currently “works” but the teams are not in alphabetical order. When I tried to just order with ‘’, it errord saying so no such column. So I must be doing it wrong, I did read the docs but couldn’t find this specific example, I may have missed it though.

Here’s the relevant part: Joining with Relations