@php $flag = true; if (isModuleActive('Organization') && Auth::user()->isOrganization()) { if($query->course->user_id == auth()->id() || $query->course->user->organization_id == auth()->id()){ $flag = true; }else{ $flag = false; } } @endphp @if ($query->refund != 1 && permissionCheck('course.delete') && $flag) @php $deleteUrl = route('admin.enrollDelete', $query->id); $refundUrl = route('admin.enrollDelete', $query->id) . '?refund'; $hasCertificate=false; if ($query->course->certificate_records->where('student_id', $query->user_id)->count() > 0) { $hasCertificate = true; } @endphp @endif