Answer the question
In order to leave comments, you need to log in
Laravel many domains 1 application?
There are:
- many domains
- 1 controller
- templates for each of the domains
/public/views/templates/domain1/
/public/views/templates/domain2/
How to make sure that the required "site" is given for each of the domains.
Nginx I assume will be configured for this laravel application.
root =~ "/home/my-server/laravel-app/public/" ?
Answer the question
In order to leave comments, you need to log in
Just substitute the current domain from the $_SERVER array in the path to the template.
This is if your web server will look into the /public/ directory. And the controller does not play any role here, you are only going to change the paths to the files in this way.
And if, depending on the domain, you need to give the corresponding template, then you can do this, for example, in the controller:
The login.blade.php template from the /domain/auth/ directory will be given
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question