L
L
lukoie2017-07-30 17:14:56
Laravel
lukoie, 2017-07-30 17:14:56

How to distribute subdomains to users in a Laravel application?

Service on Laravel becomes. There are four types of users, with their own rights.
It is necessary that each registered user with "X" rights, when filling in his data in the dashboard, could specify the desired subdomain to get a simple one-page on the subdomain.
Advise where to look for this task.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Barmunk, 2017-07-30
@Barmunk

in the doc https://laravel.com/docs/5.4/routing#route-group-s...

Route::domain('{account}.myapp.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

Based on this, you can make a user->domain connection and add it to the route logic
. For example, there is a similar manual https://www.dunebook.com/use-subdomain-in-routes-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question