Declaration of jsonSerialize() must be compatible
mialyGit opened this issue · comments
For the overload (or implementation of an interface) of a method to be valid, the signatures of the methods must be identical. Here, the jsonSerialize() method of the BenjaminHirsh/NovaSlugField/slug class must have the exact same signature as that of the Laravel/Nova/Fields/Field class.
To resolve this error, check the declaration of the jsonSerialize() method in the BenjaminHirsh/NovaSlugField/slug class and ensure that it has the same signature as that of the parent class Laravel/Nova/Fields/Field.
I replace with this :
public function jsonSerialize() : public function jsonSerialize() : array
{
return array_merge([
'disableAutoUpdateWhenUpdating' => $this->disableAutoUpdateWhenUpdating,
'slugifyOptions' => $this->slugifyOptions,
'showPreviewUrl' => $this->showUrlPreview,
'slugPrefix' => $this->slugPrefix,
], parent::jsonSerialize());
}
{
return array_merge([
'disableAutoUpdateWhenUpdating' => $this->disableAutoUpdateWhenUpdating,
'slugifyOptions' => $this->slugifyOptions,
'showPreviewUrl' => $this->showUrlPreview,
'slugPrefix' => $this->slugPrefix,
], parent::jsonSerialize());
}
PR #36 has been merged and a new tag (1.4.0) has been released.