mostafalaravel
8 months ago

how to modify the returned result from eloquent to convert json string to json object

Posted 8 months ago by mostafalaravel

Hello, this is the code :

        $participation = participation_detail::find($participation_id);
        return  response()->json(
            $participation
        );

the ,"complementary_zones" is text type,

{"id":10,"participation_date":"20190228","closure_date":"20190228","flop_date":"20190228","label_print_date":"20190228","participation_id":"8798#K4143","firstname":"Merlin","name":"Jacobi","address":"8153 Laurie Union","streetnumber":"140","box":"1571","zipcode":"93711-1755","city":"Edhaven","country":"Italy","telephone":"423-253-5876 x08410","mobile":"203.992.2620","email":"[email protected]","iban":"3277145622799890","bic":"DHBIDSFR","internal_lot_number":"xxx","external_lot_number":"xxx","external_key":"xxx","status":"1A","status_text":"xxx","amount":"xxx","original_participation_id":"4431","refusal_responds_participation_id":"155236","refusal_responds_date":"20190228","complementary_zones":"[{\"name\":\"value\",\"value\":\"value\",\"is_internal\":\"value\"},{\"name\":\"value\",\"value\":\"value\",\"is_internal\":\"value\"},{\"name\":\"value\",\"value\":\"value\",\"is_internal\":\"value\"},{\"name\":\"value\",\"value\":\"value\",\"is_internal\":\"value\"},{\"name\":\"value\",\"value\":\"value\",\"is_internal\":\"value\"}]","articles":"xxx","refusals":"xxx","client_requests":"xxx","complaints":"xxx"}

I would like to convert "complementary_zones" to object json .

thanks

Please sign in or create an account to participate in this conversation.