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

komisia's avatar

Bug on Nova::initialPath

Nova 4 doc: https://nova.laravel.com/docs/installation.html#customizing-nova-s-initial-path

In addition to a string path, the initialPath method also accepts a closure that returns the path that should be loaded.

when closure is provided, the base url "my.app/nova" returns error:

Object of class Closure could not be converted to string

Logo link works fine, but redirection from base url - not.

my code in NovaServiceProvider.php:

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        Nova::initialPath(function ($request) {
            return '/test';
        });
    }
0 likes
0 replies

Please or to participate in this conversation.