moonshine-software / moonshine

Laravel Admin panel and more. Simple for beginners and powerful for experts. Using Blade, Alpine.js and Tailwind CSS.
https://moonshine-laravel.com
MIT License
797 stars 105 forks source link

change the import or export implementation isn't working #1351

Closed Luisby47 closed 3 days ago

Luisby47 commented 3 days ago

Description

MoonShine Version

2.23.2

Laravel Version

11.34.2

PHP Version

8.2

My code:

I generated a custom Import equal to ImportHandler of Moonshine, I just changed the label of toast.

   public function import(): ?ImportHandler
    {
        return CustomImportHandler::make("Importar");
    }

The error:

App\MoonShine\Resources\CrnubeSpreedsheatConceptosResource::import(): Return value must be of type ?MoonShine\Handlers\ImportHandler, App\MoonShine\Handlers\CustomImportHandler returned_

lee-to commented 3 days ago

Your custom import should inherit ImportHandler and override what you need inside