Level 58
This error message usually occurs when the field type is not recognized by Nova. In this case, the issue might be with the map method. Try changing the map method to resolveUsing method and see if it resolves the issue. Here's an example:
Badge::make('Type')->resolveUsing(function ($value) {
switch ($value) {
case 1:
return '<span class="badge badge-info">Credit Card</span>';
case 2:
return '<span class="badge badge-info">ASH</span>';
default:
return '';
}
}),
This code will create a badge with the label "Credit Card" or "ASH" based on the value of the field.