@foreach($item_leave->pertanyaans as $pertanyaan) @php $data = $pertanyaan->responden($tahun->id)->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', $tahun->id)->get(); $default = \App\Models\ProdeskelHasDefault::where('prodeskel_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $pertanyaan->id)->where('prodeskel_tahun_id', $tahun->id)->get(); } @endphp @endforeach