Property [id] does not exist on this collection instance 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;
});