I am making a addon and i whan to iterate over all the entry's within a collection.

ProCommerceController.php

$collection = Entry::whereCollection('pro_commerce')->values()->all();

foreach ($collection as $item) {

    dd($item);

}

when i dd() this i get a collection, till here it works fine. But if i want to access my data i get a 'Cannot access protected property' error, does someone know how to get to my data in a entry collection

Answered by Erin Dalzell! Go to answer.