I need to obtain the "ID" and "name" fields from a pivot table, I tried this:
public function Display(){
$langservice = new langService();
$musgroups=$langservice->getMusgroup(session()->get('lang_id'));
foreach($musgroups as $musgroup1){
foreach($musgroup1 as $musgroup){
echo 'name:'+$musgroup->name;
}
}
But this error appears "Trying to get property of non-object" I tried to "print_r($musgroups);" but it displays all the information in a loop (12 times exactly)