This guide shows you how you can easily build a custom domains feature for users in your Laravel app, with code examples, and a complete working repo you can play with. There's a bonus section about how you can use Approximated to manage SSL certs, but it's completely optional.
Doing exactly the same with rails!