SpartnerNL / Laravel-Nova-Excel

🚀 Supercharged Excel exports for Laravel Nova Resources
https://docs.laravel-excel.com/nova/1.0/
MIT License
374 stars 73 forks source link

[BUG] Crash with Nova 4.24.0; parameter type declaration mismatch in withName #161

Closed Synchro closed 1 year ago

Synchro commented 1 year ago

Versions

Description

After updating to Nova 4.24.0, I immediately started getting this crash:

Symfony \ Component \ErrorHandler \ Error \ FatalError
Declaration of Maatwebsite\LaravelNovaExcel\Actions\ExportToExcel::withName(string $name) must be compatible with Laravel\Nova\Actions\Action::withName($name)

Steps to Reproduce

Straightforward inspection of the code shows this error is correct:

From LaravelNovaExcel:

    public function withName(string $name)
    {
        $this->name = $name;

        return $this;
    }

From Nova:

    public function withName($name)
    {
        $this->name = $name;

        return $this;
    }

While this could be fixed by removing the parameter type from the declaration, this is an inherited method that is otherwise unchanged, so it can just be deleted.

Synchro commented 1 year ago

BTW I've not checked if there are any other instances of this problem in the class.

Synchro commented 1 year ago

Update – I made this change manually, and Nova no longer crashes, so I think this is the only instance.

patrickbrouwers commented 1 year ago

Fix has been released