@php $xy = 0; $x = 0; $photoall = array(); foreach($photo as $p){ if(isset($p->st)){ if($p->st==0 || $p->st==1){ $photoall[$x]['nu'] = $p->nu; $photoall[$x]['ns'] = $p->ns; $photoall[$x]['na'] = $p->na; $photoall[$x]['sc'] = $p->sc; $photoall[$x]['st'] = $p->st; $photoall[$x]['tx'] = $p->tx; $x++; } } } @endphp