I have two models, Post and Comment; many comments belong to a single post. I\'m trying to access all comments associated with a post as an array.<
Post
Comment
Try collect function in array like:
$comments_collection = collect($post->comments()->get()->toArray());
this methods can help you
toArray() with collect()