Laravel Valet with SubDomain

In order to allow to use Laravel Sub Domain Route in Your Laravel Valet.

Let’s say my project folder name is ‘forum’. I would like the forum users to have their own public profile page via sub-domain.

Here is my route file:-

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

In my Valet Folder. I need to use a symlink to archive the goal. In my case, I use Ken as a test user. Unfortunately, you can’t archive it via wildcard in Valet.

ln -s forum ken.forum

That’s all. Happy Coding

Leave a Reply

Your email address will not be published. Required fields are marked *