limit(1); $items = $query->get(); $atLeastOne = $items->count() > 0; } else { $query .= " LIMIT 1"; $items = DB::select($query); $atLeastOne = !empty($items); } // Initializing the response variable $response = []; // The scope for the first version of this feature is only for unassigned list, so, this value is currently fixed $response[] = ['item' => 'CASES_SELFSERVICE', 'highlight' => $atLeastOne]; // Print the response in JSON format header('Content-Type: application/json'); echo json_encode($response);