This might seem surprising given how strict airport security is, but it might be totally legal. The Transportation Security Administration (TSA) notes:
You may transport unloaded firearms in a locked hard-sided container as checked baggage only. Declare the firearm and/or ammunition to the airline when checking your bag at the ticket counter. The container must completely secure the firearm from being accessed. Locked cases that can be easily opened are not permitted. Be aware that the container the firearm was in when purchased may not adequately secure the firearm when it is transported in checked baggage.
One caveat: There can be some variations on which guns are allowed depending on local, state, and national laws.
Keep in mind this procedure is only for checked luggage, not a carry-on bag. So a gun in a checked bag wouldn’t be easily accessible within an airplane.
The shooter reportedly flew in from outside Florida, picked up his luggage at baggage claim, loaded the gun in the bathroom, walked out, and opened fire, according to the county commissioner. Police have so far confirmed at least five dead and eight injured.