[Vuejs]-Axios method to update database field using vue.js and Laravel

1👍

You are mixing up POST and GET syntax in your axios request and your endpoint.

You’re therefore not sending any data at all to the POST endpoint – meaning that validation is failing for is_complete as both required and boolean

Try:

axios.post(
    '/profile/' + this.userId + '/' + this.item2.id,
    {is_complete : this.item2.is_complete}
)
//.........
Route::post('/profile/{user}/{task}/', 'CompleteController@store');

When debugging you might find it useful to console.log(error.response.data) so that you can review your validation errors.

👤Rory

Leave a comment