How can setup subdomain in laravel 10

I am trying to set up a subdomain in my project, but it is not working for some reason.

Route::domain('{username}.' . env('APP_URL'))->group(function () {
    return  "test";
});

It is not returning a thing. Instead, it is going to the main domain. What should I do?