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

andrei.susanu's avatar

Laravel Nova - Change Nova's API path (/nova-api/)

Hello,

I'm using Laravel Nova for a project that is deployed as a microservice under a folder structure. I cannot change this, it's apart of a bigger picture.

My application will be served under this folder: https://www.domain.com/api/somename/

I'm accessing the Nova administration page at this URL: https://www.domain.com/api/somename/admin

I've configured and deployed my Nova application, but Nova is making all AJAX calls to /nova-api/ - in my case to:

https://www.domain.com/nova-api/

This is bad, because it's outside of my microservice.

I'm looking for a way to make Nova move it's nova-api to https://www.domain.com/api/somename/nova-api/

Thanks!

0 likes
3 replies
willvincent's avatar

You'd have to override the nova service provider, that's where the route prefix is defined.

andrei.susanu's avatar

I need some more details, please.

I cannot find anything relevant in NovaServiceProvider.

Thanks!

willvincent's avatar
Level 54

I don't use nova, so it's possible it's changed from this older version, though I sort of doubt it...

/**
     * Get the Nova route group configuration array.
     *
     * @return array
     */
    protected function routeConfiguration()
    {
        return [
            'namespace' => 'Laravel\Nova\Http\Controllers',
            'domain' => config('nova.domain', null),
            'as' => 'nova.api.',
            'prefix' => 'nova-api',
            'middleware' => 'nova',
        ];
    }

Extend the provider, override this method, and change the prefix as needed, then use your provider instead of the default.

You could probably also manipulate the routes with your own provider after nova has added them instead of overriding the default nova service provider

Please or to participate in this conversation.