I have a checkbox on my VueJS site, I want to do the following: if the checkbox special is true, then send in database value 1 in column, how can I do this correctly?
I did like this:
<label class="checkbox-control">
<input type="checkbox" v-model="special" v-on:change="special" :disabled="channel.length === 0">
<div class="checkbox-control__content"><i></i>Test</div>
</label>
data() {
return {
channel: "",
special: false,
}
sendFunction() {
this.$root.axios.post("/user/userPromo", {
channel: this.channel,
special: this.special
}).then((res) => {
const data = res.data;
this.$root.showNotify(data.type, this.$t(`index.${data.message}`, {
name: data.name
}));
});
},
And in backend when i add data in table, i use $special = $r->get('special');, but it doesn't want to work. When is my mistake?