gobrightspot / nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.
MIT License
168 stars 50 forks source link

Declaration of Brightspot\Nova\Tools\DetachedActions\DetachedAction::jsonSerialize() must be compatible with Laravel\Nova\Actions\Action::jsonSerialize(): array #80

Closed HeadStudios closed 1 year ago

HeadStudios commented 1 year ago

I have received the following error after installing this through Composer in my Laravel Nova app and attaching it to a Contact resource model as per instructions:

Declaration of Brightspot\Nova\Tools\DetachedActions\DetachedAction::jsonSerialize() must be compatible with Laravel\Nova\Actions\Action::jsonSerialize(): array

Please provide any input to fix this. Thank you!

HeadStudios commented 1 year ago

I can confirm modifying Ln 115 in /vendor/gobrightspot/nova-detached-action/src/DetachedAction.php

from

public function jsonSerialize()

to

public function jsonSerialize() : array

has fixed this issue for me and I suggest an update to the source code to refelct this as I suspect this is incompatible with the latest version of Laravel Nova as it stands now.

Thank you!