Answer the question
In order to leave comments, you need to log in
Serving two domains with one Laravel at the same time (multisiting) - how to do it?
Hello.
There are two third-level domains sub.site1.ru and sub.site2.ru.
You need to set up an essentially identical service on them, but with slight differences in design for each site, and a little different functionality (at the controller level).
Is it possible to somehow resolve this within a single Laravel application?
And if - "Yes" - then what exactly should be written in the routes?
Thank you.
Answer the question
In order to leave comments, you need to log in
Thanks to Alex Wells , the solution seems to be found:
Route::domain('sub.{domain}.ru')->group(function () {
Route::get('domaintest', function ($domain) {
dd($domain);
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question