Use instead of this $IsExist = DB::table('tbl_marks_distributions') ->select('marks_distribution_id', 'full_marks', 'allowed_input_date_time_from', 'allowed_input_date_time_to', 'is_active', 'pass_marks', 'percent') ->where('subject_id', $sub->subject_id) ->where('class_id', $ClassID) ->where('group_id', $GroupID) ->where('institute_branch_version_id', $branchShiftVersion) ->where('exam_type_id', $ExamTypeID) ->where('exam_sub_head_id', $esh->exam_sub_head_id) ->where('exam_head_id', $ExamHead) ->where('academic_year', $Year) ->where('section_id', $Section) ->first();
as like below,
$IsExist = DB::table('tbl_marks_distributions')
->pluck('marks_distribution_id', 'full_marks', 'allowed_input_date_time_from', 'allowed_input_date_time_to', 'is_active', 'pass_marks', 'percent')->first();