سلام
قطعه کد پایین رو داخل VueJS دارم:
export default {
props: [
'post_url'
],
data() {
return {
id: ۱,
type: "",
price: "",
product: {
title: "",
types: [],
}
}
},
methods: {
add() {
this.product.types.push({
id: this.id,
type: this.type,
price: this.price
});
this.id++;
this.type = "";
this.price = "";
},
submit() {
axios.post(this.post_url, this.product).then(response => console.log(response.data)).catch(error => console.log(error.response.data));
}
}
}
داخل کنترلر لاراول هم چنین کدی دارم خیلی ساده:
Product::create($request->all());
حالا وقتی تو فرم Submit میزنم خطای Array to string conversion میگیرم.
کسی به این مشکل خورده؟
شاید پاسخ شما همینجا باشد