Najdah wrote to Ibn Abbas (may Allah be pleased with them both): Did the Messenger of Allah (peace and blessings be upon him) fight along with women? And did he give them a share? Ibn Abbas (may Allah be pleased with them both) replied: Women used to be with his (peace and blessings be upon him) army and they would treat the wounded, but they had no share of the spoils; rather, he (peace and blessings be upon him) would give them something as a gift.
Imam al-Shafi'i (may Allah have mercy on him) said: The established report is that slaves and boys also took part in the fighting with the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) would give them a gift from the spoils.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17851