{"id":38,"date":"2020-02-23T18:50:35","date_gmt":"2020-02-23T23:50:35","guid":{"rendered":"https:\/\/davidgrzyb.com\/?p=38"},"modified":"2021-02-13T15:27:10","modified_gmt":"2021-02-13T20:27:10","slug":"laravel-dynamic-domain-routing-cloudways","status":"publish","type":"post","link":"https:\/\/davidgrzyb.com\/laravel-dynamic-domain-routing-cloudways\/","title":{"rendered":"Allowing User Custom Domains in Laravel with Cloudways"},"content":{"rendered":"\n

When building rokk.it<\/a>, I wanted to give users’ the ability to add their own domains for URL redirections. A simple idea proved to be more complex than I thought, and I ended up using a tutorial, which can be found here<\/a>, that allowed me to achieve my goal of having dynamic domain routing quite easily.<\/p>\n\n\n\n

Laravel supports subdomain routing out-of-the-box, however getting full domains to route dynamically is not offered. The author of the article above created a work around for this by modifying the boot method of his RouteServiceProvider.php file.<\/p>\n\n\n\n