dcasia / column-toggler

A Laravel Nova package that allows you to hide/show columns in the index view.
MIT License
40 stars 5 forks source link

Fix for declaration error #18

Closed stllmtbrt closed 10 months ago

stllmtbrt commented 10 months ago

Here is another small pull request. The signature of ColumnTogglerTrait::serializeForIndex() differs from Laravel\Nova\Resource::serializeForIndex() and also from a package we use (Outl1ne\NovaSortable\Traits\HasSortableRows::serializeForIndex()).

(The signature in column-toggler contains a return type array, the other two sources do not contain a return type)

This leads to errors in my system: Declaration of Outl1ne\NovaSortable\Traits\HasSortableRows::serializeForIndex(Laravel\Nova\Http\Requests\NovaRequest $request, $fields = null) must be compatible with App\Nova\Resource::serializeForIndex(Laravel\Nova\Http\Requests\NovaRequest $request, $fields = null): array

Tested on Nova 4.29.5

KasparRosin commented 8 months ago

@milewski Hey, can we have this fix released too. Would like to switch off from main tag, just to avoid breaking issues.

Edit: Nevermind, the issue was that I'm not on laravel-nova 4.28 yet. I thought why my composer version was not the latest.