Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Nova 4.0 - PHP Fatal error: Class KABBOUCHI\LogsTool\LogsTool contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Laravel\Nova\Tool::menu) #43

Open
eugenefvdm opened this issue Apr 6, 2022 · 14 comments
Labels
help wanted Extra attention is needed

Comments

@eugenefvdm
Copy link
Contributor

Hi there!

Sorry about the long title, but dying to use the log tool with Nova 4.0 as it will open upgrading many sites and being on top of problems.

The error received is a blank Nova landing page and in the error log file:

PHP Fatal error:  Class KABBOUCHI\LogsTool\LogsTool contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Laravel\Nova\Tool::menu)

I believe the abstract method is here vendor/laravel/nova/src/Tool.php:

/**
     * Build the menu that renders the navigation links for the tool.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return mixed
     */
    abstract public function menu(Request $request);

I would like to see if I can implement that abstract method but I'm not sure where! Any tips would help.

The docs are here:
https://nova.laravel.com/docs/4.0/upgrade.html#updating-custom-tool-cards-fields-filters

With luck one wouldn't need to do all the other VueJS stuff. Any clues?

@eugenefvdm eugenefvdm changed the title Upgrade to Nova 4.0 - PHP Fatal error: Class KABBOUCHI\LogsTool\LogsTool contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Laravel\Nova\Tool::menu Upgrade to Nova 4.0 - PHP Fatal error: Class KABBOUCHI\LogsTool\LogsTool contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Laravel\Nova\Tool::menu) Apr 6, 2022
@ronnytorresmtz
Copy link
Contributor

Hi, I found in the upgrade documentation these comments,

Nova Request
Nova 4 updates a variety of methods to accept a Laravel\Nova\Http\Requests\NovaRequest instance instead of an Illuminate\Http\Request instance. An overview of the methods that have been updated is provided below so you may update your method signatures accordingly.

@Kussie
Copy link

Kussie commented Apr 6, 2022

The error with the menu method can be fixed by adding the following to the LogsTool.php file

    /**
     * Build the menu that renders the navigation links for the tool.
     *
     * @param  \Illuminate\Http\Request $request
     * @return mixed
     */
    public function menu(Request $request)
    {
        return MenuSection::make('LogsTool')
            ->path('/logs')
            ->icon('server');
    }

However this doesn't fix the package, more work needs to be done to get it functional again, specfically on the Intertia and JS side of things it looks like

@eugenefvdm
Copy link
Contributor Author

@Kussie thank you so much! This is a good start, because now I can do a pull request and move past the most critical issue that causes the entire Nova to stop working. My VueJS and Inertia knowledge is not great but I'll follow the manuals and see how far I get. Thanks again, this was the initial hurdle I needed to cross.

@KABBOUCHI KABBOUCHI added the help wanted Extra attention is needed label Apr 8, 2022
@stepanenko3
Copy link

stepanenko3 commented Apr 13, 2022

I did not see any response to this problem from the repository owner and concluded that the owner has no plans to support and update the package
I made my own fork that supports Nova 4, dark mode, responsive, includes bug fixes and a few improvements

https://github.com/stepanenko3/nova-logs-tool.git

composer require stepanenko3/nova-logs-tool

Pr a welcome

@KABBOUCHI
Copy link
Owner

@stepanenko3 why u don't open a PR?

@stepanenko3
Copy link

@KABBOUCHI I'll open a PR a bit later if you're ready to migrate to 4.0

@anditsung
Copy link
Contributor

@KABBOUCHI I'll open a PR a bit later if you're ready to migrate to 4.0

its been 15 days. and still no PR?

@stepanenko3
Copy link

stepanenko3 commented Apr 28, 2022

@anditsung, I don’t have time to change Namespaces back now

If you have time for this, send me a PR and I will open the corresponding PR to this repository

And of course, I’m still testing it in my Dev Server to do PR without bugs

@anditsung
Copy link
Contributor

@KABBOUCHI already create a PR for nova4 from this branch

@stepanenko3
Copy link

@anditsung why didn’t you create a PR with changing Namespaces in my repository?

@anditsung
Copy link
Contributor

@anditsung why didn’t you create a PR with changing Namespaces in my repository?

the question is why do you have to change namespace from original repository?

@stepanenko3
Copy link

@anditsung

  1. The repository looked as if the author was not ready to support it, issues that are done in 5-15 minutes hung for a long time without attention

  2. It was more convenient for me to test this in several of my projects in order to take into account all the nuances. Because to upload files to each project and do it in each project

@anditsung
Copy link
Contributor

author already add help-wanted tag and maybe author haven't got new license for nova4. you can create a PR for the repo not hijacking.

to test using original repo all you have to do is add the config to the composer

"repositories": {
        "nova-logs-tool": {
            "type": "vcs",
            "url": "https://github.com/anditsung/nova-logs-tool"
        }
    }
"require": {
        "kabbouchi/nova-logs-tool": "dev-support-nova-4",
}

@KABBOUCHI
Copy link
Owner

author already add help-wanted tag and maybe author haven't got new license for nova4. you can create a PR for the repo not hijacking.

to test using original repo all you have to do is add the config to the composer

"repositories": {
        "nova-logs-tool": {
            "type": "vcs",
            "url": "https://github.com/anditsung/nova-logs-tool"
        }
    }
"require": {
        "kabbouchi/nova-logs-tool": "dev-support-nova-4",
}

Yes, didn't get my v4 license yet

I've released your PR thank you v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants