@foreach($item_leave->pertanyaans->where('prodeskel_categorie_id', '15') as $pertanyaan) @php $data = $pertanyaan->anggota($tahun->id)->wherePivot('prodeskel_anggota_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\ProdeskelAnggotaHasAnswer::where('prodeskel_anggota_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $pertanyaan->id)->where('prodeskel_tahun_id', $tahun->id)->get(); $default = \App\Models\ProdeskelAnggotaHasJawaban::where('prodeskel_anggota_responden_id', $prodeskelResponden->id) ->where('prodeskel_question_id', $pertanyaan->id)->where('prodeskel_tahun_id', $tahun->id)->get(); } @endphp