MCQs > Website Designing & Development > Laravel Framework > Which is correct to retrieve all comments which are associated with single Post (post_id = 1) with one to many relation in Model?

Laravel Framework MCQs

Which of the following is correct to retrieve all comments which are associated with single Post (post_id = 1) with one to many relation in Model?

Answer

Correct Answer: $comments = App\Post::find(1)->comments;

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Laravel Framework Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Laravel Framework Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it