We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e64e571 commit 58135eaCopy full SHA for 58135ea
src/Schema/Concerns/HasMeta.php
@@ -2,11 +2,14 @@
2
3
namespace Tobyz\JsonApiServer\Schema\Concerns;
4
5
-use Closure;
6
use Tobyz\JsonApiServer\Context;
+use Tobyz\JsonApiServer\Schema\Field\Attribute;
7
8
trait HasMeta
9
{
10
+ /**
11
+ * @var Attribute[]
12
+ */
13
public array $meta = [];
14
15
/**
@@ -30,7 +33,7 @@ protected function serializeMeta(Context $context): array
30
33
31
34
$value = $field->getValue($context);
32
35
- $meta[$field->name] = $value instanceof Closure ? $value() : $value;
36
+ $meta[$field->name] = $field->serializeValue($value, $context);
37
}
38
39
return $meta;
0 commit comments