Thursday, March 30, 2017

Laravel 5.2 exclude column from the json response which is in foreign key relationship

[ { "template_id": 2, "title": "news surey2345", "instructions": " this is news surey2345", "reference": "a426a9288424ff3d540115ffc38bd0b4", "status_id": 1, "published_date": "2017-03-30 11:12:48", "expiry_date": null, "survey_template": { "is_public": 0, "submission_type": 1, "id": 2 }, "questiongroup": [ { "survey_id": 17, "title": "question group 2", "instructions": " this is question group 2", "has_free_text": 1, "sort": 4, "id": 19, "question": [ { "id": 58, "question_type_id": 1, "question_group_id": 19, "title": "question3", "can_upload_file": 0, "can_comment": 0, "include_na_answer": 1, "sort": 31, "question_answers": [ { "question_id": 58, "answer": "answer1", "points": "12", "id": 206 }, { "question_id": 58, "answer": "answer2", "points": "11", "id": 207 }, { "question_id": 58, "answer": "NA", "points": "0", "id": 208 } ], "question_type": { "slug": "multi-choice", "id": 1 } }, { "id": 134, "question_type_id": 1, "question_group_id": 19, "title": "question3", "can_upload_file": 0, "can_comment": 0, "include_na_answer": 1, "sort": 33, "question_answers": [], "question_type": { "slug": "multi-choice", "id": 1 } }, { "id": 161, "question_type_id": 1, "question_group_id": 19, "title": "question3", "can_upload_file": 0, "can_comment": 0, "include_na_answer": 1, "sort": 34, "question_answers": [], "question_type": { "slug": "multi-choice", "id": 1 } }, { "id": 165, "question_type_id": 1, "question_group_id": 19, "title": "question3", "can_upload_file": 0, "can_comment": 0, "include_na_answer": 1, "sort": 35, "question_answers": [], "question_type": { "slug": "multi-choice", "id": 1 } } ] } ] } ]

i want to exclude question_type_id from questioon,please help me



via komal Thakkar

Advertisement