$row->sub_category[0]->name
when i checked other questions, i could see that there is option to access the first and last elements, but is there a