I
I
Ilya T2018-03-10 18:23:00
Laravel
Ilya T, 2018-03-10 18:23:00

How to use subdomain in Laravel?

Tell me how to correctly implement subdomains in Laravel, I did it according to the manual , but on both subdomains it gives out the same old pages (welcome view).
Here is the route code

Route::domain('admin.'. env('APP_DOMAIN'))->group(function()
{
        return 'My admin domain';
});

Route::get('/', function () {return view('welcome');});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2018-03-10
@I-ilya

The group is not a route in itself, you need to create separate routes inside it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question