Well, to tackle this i created my custom select2 with the checkboxes functionality. I attach my GitHub repository link below. Whenever you want to add this functionality, just add this class, customselect Suppose if you want to add multiple custom checkboxes, select2 don't worry, just add this class customselect, in the select tag
https://github.com/hammadshah01/Custom-Select2-with-Checkbox