I have a Laravel project where I am using the vuexy theme. I've been trying to add an onchange event to my select2 input, but so far I haven't had any success.
Here is my select2 input:
<div class="col-12 mb-2">
<label class="form-label" for="personalSelect">Personel</label>
<select class="select2 form-select" id="personalSelect" name="personal_id" required>
<option value="" selected disabled>Personel Seçiniz</option>
@foreach ($savedPersonals as $personals)
<option value="{{ $personals->id }}">{{ $personals->name }}</option>
@endforeach
</select>
</div>
This is my JavaScript code:
$('#personalSelect').on('select2:select', function(e) {
console.log("test");
});