@foreach($survey_data as $item) @php $beneficairy_details=json_decode($item->beneficiary_details); // authenticate uc means uc is in user account $authenticate_user_uc=json_decode(Auth::user()->uc_id); // current status of ip $form_status=\DB::table('form_status')->where('form_id',$item->survey_form_id)->where('update_by','IP')->first(); // senior status to find about his rejection commnet $seniorpost=\DB::table('form_status')->where('form_id',$item->survey_form_id)->where('update_by','HRU')->first(); @endphp {{-- here three condition must be filfil 1- form uc must be include in user account 2-junior user role verify according to the form step 3 form must be in pending condition --}} @if(in_array($item->uc_id,$authenticate_user_uc) && ($item->user_status=='30' || $item->user_status=='51' || $item->team_member_status=='field_supervisor') && ($form_status==null || $form_status->form_status=='P'))