I have a Laravel 8.40 backend with many routes, and when I was adding scribe to the project I realized that many routes are twice listed.
Calling php artisan route:list
as example, it will duplicate the route api/hq/v1/account/login
, removing the v1/account
portion:
POST api/hq/login login App\Http\Controllers\Hq\Account@logIn
POST api/hq/v1/account/login login App\Http\Controllers\Hq\Account@logIn
I want to have just api/hq/v1/account/login
.
routes/api.php
Route::group(['prefix' => 'hq'], function(){
includeRouteFiles(__DIR__.'/api/hq/');
});
routes/api/hq/index.php
Route::group(['prefix' => 'v1'], function(){
Route::group(['prefix' => 'account'], function(){
includeRouteFiles(__DIR__ . '/account/');
});
});
routes/api/hp/account/index.php
Route::post('/login', [Account::class, 'logIn'])->name('login');
Already ran php artisan route:clear
.
...
How can I fix it?
Thank you all in advance!