1

I am using p2made/yii2-uuid: * this extension to generate UUID to get UUID

 $varUuid = \p2made\helpers\Uuid\UuidHelpers::uuid();
 mapping uuid to model--->
 $model->expenses = $varUuid;

if i echo $model->expenses it shows uuid but if i print $model->expenses it
is converted to object i cant to send to API.. how can i do this i need to send uuid with model field with uuid value?

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107

1 Answers1

0

Assign the actual UUID value to expenses field this way.

$model->expenses = $varUuid->toString();

The helper file that you utilised are extending from ramsey/uuid. You can view the usage examples here.

Hanafi
  • 151
  • 6