LoveCoding
LoveCoding

Reputation: 1211

Does Laravel Forge provide Domain Park API?

I am creating Multi-tenant website using Laravel.

Does Laravel forge provide domain mapping API?

I would like to let users use their own domain instead of our subdomain.

For example: user will get subdomain in our website.

https://username.mywebsite.com

And if he has his domain userdomain.com, he will be able to change CNAME in domain registrar so that he can use his own domain instead of our website subdomain.

And also on my side, I will need to park that domain on the my project domain.

https://username.mywebsite.com // subdomain of our website.
https://userdomain.com // user's own domain

For now, I am using Cpanel API to park user's domain on our website.

I am quite new on laravel forge and if there is the way to park domain using laravel forge API, it will be great.

Any suggestion would be highly appreciated.

Upvotes: 1

Views: 310

Answers (1)

Chris
Chris

Reputation: 58292

This is not possible directly from the Forge UI.

However, you could comfortably create a new alias for each new client via the API, specifically the update site endpoint: https://forge.laravel.com/api-documentation#update-site

Just be mindful you will need to pass the full list of aliases each time, including your mywebsite.com domain. This can easily be done by fetching the site first.

Upvotes: 1

Related Questions