Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RajanSingh's avatar

subdomain as api

Hello, I want to create api as a subdomain. for example if I hit http://api.domain.com/v1 should point "domain.com/api/v1".

I tried this

Route::domain('api.domain.com')->group(function () {

Route::prefix('api/v1')->group(function () {

    Route::get('/', 'HomeController@api')->name('api');

});

    });

but nothing is working.

0 likes
1 reply

Please or to participate in this conversation.