@foreach($item_leave->pertanyaans->where('prodeskel_categorie_id', '14') as $pertanyaan) @php $data = $pertanyaan->responden(1)->wherePivot('prodeskel_responden_id', $prodeskelResponden->id)->first(); $jawaban = null; $default = null; $multiple = null; if(empty($data) || is_null($data)){ $empty = true; }else{ $empty = false; $data = $data->pivot; $multiple = \App\Models\ProdeskelHasAnswer::where('prodeskel_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $pertanyaan->id)->where('prodeskel_tahun_id', 1)->get(); $default = \App\Models\ProdeskelHasDefault::where('prodeskel_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $pertanyaan->id)->where('prodeskel_tahun_id', '1')->get(); } @endphp @endforeach