KABBOUCHI / nova-logs-tool

A Laravel Nova tool to manage and keep track of each one of your logs files.
MIT License
73 stars 17 forks source link

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 2 years ago

eugenefvdm commented 2 years ago

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?

ronnytorresmtz commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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.

stepanenko3 commented 2 years ago

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 commented 2 years ago

@stepanenko3 why u don't open a PR?

stepanenko3 commented 2 years ago

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

anditsung commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

@KABBOUCHI already create a PR for nova4 from this branch

stepanenko3 commented 2 years ago

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

anditsung commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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