remove "api" prefix from api routes laravel 11 My app is an API that doesn't use the web middleware group and doesn't have web routes. How can I customize such that the api routes don't have the "api" prefix.
in bootstrap/app
->withRouting(
web: __DIR__ . '/../routes/web.php',
api: __DIR__ . '/../routes/api.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
withRouting takes an apiPrefix argument, so
->withRouting(
web: __DIR__ . '/../routes/web.php',
api: __DIR__ . '/../routes/api.php',
apiPrefix: '',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
Please sign in or create an account to participate in this conversation.