A
A
Analka2020-01-14 13:38:27
Laravel
Analka, 2020-01-14 13:38:27

Laravel subdomain in route?

there is a site site.ru
when you click on the site.ru/cabinet link, you need the redirect to be on
cabinet.site.ru
write route like this

Route::domain('{cabinet}.site.ru')->namespace('Cabinet')->middleware('auth')->group(function () {
    Route::get('/','[email protected]')->name('profile');
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Barsukov, 2020-01-14
@slavabars

well, if the question is in a redirect, then https://laravel.com/docs/5.8/routing#redirect-routes or https://laravel.com/docs/5.8/redirects
routers + the domain itself must have an alias to the subdomain - this is in the settings of the web server itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question