Redirect nova admin

i am working on a project using Laravel Nova, this is the issue i am facing and can't figure it out why Enlightn is still failing:

in NovaServiceProvider in boot() method i have

/** @var Request $request */
        $request = $this->app->request;

        /**
         * Redirect to /admin/login instead of /admin/dashboards/main
         * on logout to avoid broken HTTP Basic Authentication.
         */
        if ($request->getRequestUri() === '/admin/logout') {
            Nova::initialPath('login');
        }

To Redirect to /admin/login instead of /admin/dashboards/main on logout to avoid broken HTTP Basic Authentication.

and this what i am getting from Enlightn:

Check 36/82: Your application does not access class properties in an invalid manner. Failed
Your application seems to reference class properties that are either undefined or not accessible.
At app/Providers/NovaServiceProvider.php, line 54: Access to an undefined property Illuminate\Contracts\Foundation\Application::$request.

any help is appreciated!!! :)

May
May
0
1
358
May
May
Solution

i got the solution, never mind :)

it's pretty straightforward, here how i solved and Enlightn does't fail.

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        parent::boot();

        Nova::whenServing(function ($request) {
            //nothing
        }, function ($request) {
            if ($request->getRequestUri() === '/admin/logout') {
                Nova::initialPath('login');
            }
        });

that is it.