"Mir" is in the dative case, so shouldn't "freund" come first in the translated sentence? I lost a heart for saying "friend with me" and I don't understand why.
"mir" is in dative because it comes right after "mit". "Friend with me" would be "Freund mit mir".
Think of the dative case as more of a 'prepositional case'
Pay attention to the comma. Mit mir: with me (Dativ), Freund: (my) friend (Nom/Vocativ)