Level 50
you mention http://api.domain.com/v1, but the route definition defines this: http://api.domain.com/api/v1/
either change your prefix, or a hit this url
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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.
Please or to participate in this conversation.