Lending money to family members with conditions attached can lead to some potentially difficult personal situations, so it's sensible to try to address all potential issues at the outset, rather than after the money has changed hands.
If this is a loan, rather than a gift, you need to make sure your daughter and her boyfriend understand that. If it is the case you need to agree whether any interest will be payable and when you expect the loan to be repaid.
The situation is less clear if the loan is open-ended, if there is no interest payable and if the loan might become a gift. Do you expect to be repaid if your daughter doesn't break up with her boyfriend?
The only way to fully protect your interests is to get a legal agreement drawn up that documents this. However, you would need to take professional legal advice, which will incur costs, and by taking this route you could cause some friction with your daughter.
If your daughter is contributing £5,000 from your loan towards the deposit and her boyfriend is also contributing £5,000, then they are contributing half each. If you simply want your money back, it would seem logical this comes from your daughter rather than her boyfriend in the event they break up.
If the property is held equally by your daughter and her boyfriend, she would have a right to her share of that property anyway if they split.