// config/serializer.phpreturn [
'handlers' => [
// ...
],
'mapping' => [
Money\Token::class => [
'to' => Microservice\Payloads\Billing\Token::class,
'attributes' => [
'amount' => [
'type' => \Brick\Math\BigDecimal::class
],
]
],
],
],
// Example
$token = new Money\Token(100);
$this->app[\Butschster\Exchanger\Contracts\Serializer\ObjectsMapper::class]->toPayload($token)
// config/serializer.php
return [
'handlers' => [
\Butschster\Exchanger\Jms\Handlers\CarbonHandler::class,
\Microservice\Jms\Handlers\BigDecimalHandler::class
],
'mapping' => [
// ...
]
];