Answer the question
In order to leave comments, you need to log in
Update not working in Laravel resource?
Created a controller
php artisan make:controller LanguageController --resource --model=Model/Language
public function update(Request $request, Language $language)
public function update(Request $request, $id)
updatel(){
const that = this;
let formData = new FormData();
formData.append('id', this.edit.id);
formData.append('name', this.edit.name);
formData.append('image', this.edit.image);
formData.append('code', this.edit.code);
formData.append('locale', this.edit.locale);
formData.append('sort_order', this.edit.sort_order);
formData.append('published', this.edit.published);
formData.append('_method', 'PUT');
axios.post(this.url.update+this.edit.id, formData)
.then((response) => {
})
.catch(error => {
toast.fire({
icon: 'error',
title: error.response.data.errors
});
});
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question