collaboration in phd project from an undergrad student
That's probably a question best asked of your PhD adviser -- if you want your friend to become a co-author, your adviser will have to know about that friend's contributions anyway.

In any case, if your friend contributes significantly to the work, it's not a question of "being nice" when you think about making him a co-author: he contributed intellectually to the work, so he needs to be a co-author.

Whether that is "fair" is a different question and depends on what your friend hopes to get out of it. If he's interested in getting publications, then he may consider it fair. If he is only interested in graduating and then getting a job in industry, he may not be interested in publications and might consider money to be a better way to compensate him for the work.