I am creating a cloud based application in laravel/php.

I have a functionality where user can have their website at user.myapp.com and it works (with subdomain and model binding).

I now want to go one step further, and allow users to add their own custom domain names. So their website will be reachable at user-domain.com rather than (or as well as) user.myapp.com.

I want to understand how to do this. I'm using Laravel framework which is based on php and apache.

What kind of server do I need? Can I use shared hosting? What configs do I need to do in order for this to work? What DNS record the user must create to put things together?

You should be able to do it by setting up virtual hosts in Apache, I think.

Do i need dedicated host or shared host will be fine?