Benjacho / belongs-to-many-field-nova

Belongs To Many field Laravel nova to represent many to many relationship in field.
MIT License
157 stars 80 forks source link

JsonSerialize method not compatible #122

Open ideal1sm opened 1 year ago

ideal1sm commented 1 year ago

Hello, today I installed the package and got an error

image

Declaration of Benjacho\BelongsToManyField\BelongsToManyField::jsonSerialize() must be compatible with Laravel\Nova\Fields\Field::jsonSerialize(): array

I solved this problem by adding to the jsonSerialize method of the BelongsToManyField class, return type of array

public function jsonSerialize(): array

DzonyBB commented 10 months ago

Yes, the error is gone, but the problem is not solved. Now there is no error, but it does not display any data. Help me set it up, thank you.