framework icon indicating copy to clipboard operation
framework copied to clipboard

Custom prefix routes in RouteServiceProvider.php

Open mhsilva555 opened this issue 2 years ago • 0 comments

I added a custom prefix to my api's routes. But the answer is always 404.

Code:

Route::prefix('api/v1') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api/v1/api.php'));

File Endpoints: routes/api/v1/api.php Code:

Route::get('custom-endpoint', function () { wp_send_json( 200 ); });

Return: Sorry, the page you are looking for could not be found

mhsilva555 avatar Jan 13 '23 15:01 mhsilva555