@foreach($survey_data as $item) @php $authenticate_user_uc=json_decode(Auth::user()->uc_id); $beneficairy_details=json_decode($item->beneficiary_details); $form_status=\DB::table('form_status')->where('form_id',$item->survey_form_id)->where('update_by','field supervisor')->first(); // checking that if any form status of that form is priotize or not @endphp @if(in_array($item->uc_id,$authenticate_user_uc) && ($form_status==null || $form_status->form_status=='P')) @php $seniorpost=\DB::table('form_status')->where('form_id',$item->survey_form_id)->where('update_by','IP')->first(); @endphp