gecche / laravel-multidomain

A Laravel extension for using a laravel application on a multi domain setting
MIT License
838 stars 105 forks source link

add a landing page with a different domain #102

Closed pixsolution closed 11 months ago

pixsolution commented 11 months ago

Hello

I'm using your package for multidomain project it work well eg. domain1.com.ve, domain2.com.co..... but the project need a landing page for the general domain.com that has the typical list of countries (only that)...so I don't want to add it with the add domain command because it creates an env and asks for a database etc. which is not needed because it is a simple landing page...so how to do it?

Regards

gecche commented 11 months ago

Hi,

this is a question which is a bit outside the scope of the package because the application serving your "main" domain, even if it is a simple landing page, is totally different from the other application serving the clients.

So, a first approach could be to do a whole different project for the main domain.

However, If you want to include the main domain in the current application, note that you don't need a database etc... but as a Laravel application you will need an .env file, so I would do so:

if (env('DOMAIN_TYPE') == "main") { Route::get("/",<LANDING>) } else { Route::get("/",<STANDARD CONTROLLER>) }

Maybe there are also better approaches, but I hope this helps

Cheers

Giacomo