Property [id] does not exist on this collection instance model code example
Example: Property [id] does not exist on this collection instance.
$user = User::where('name', 'like', '%Mat%')->first();
$user->posts->each(function($post) {
echo $post->comment;
});