V
V
Vladislav2017-01-24 03:52:31
Nginx
Vladislav, 2017-01-24 03:52:31

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

2 answer(s)
M
Mysterion, 2017-01-24
@Div100

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

D
Dmitry, 2017-01-24
@ExileeD

https://laravel.com/docs/5.3/routing#route-group-s...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question