Is there a function to get All the item_id in Many to Many relations.
$subcategory = $this->subcategory->find($id);
Or Do I need to do it manually. Basically I can do it but I hope there is an aggregate function.
$itemIds=[];
foreach($subcategory->items as $item){
$itemIds[] = $item->id;
}