[Vuejs]-How to post dynamically generated vuejs array to mysql database

2👍

So you just want to post it?

methods: {
  ...
  postData: function() {
    this.http.post('your/endpoint', { items: this.cart_items })
      .then( (response) => { // your server response } )
      .catch( (error) => { // error callback } )
  }
  ...

This will post to your api endpoint so to the laravel controller from there loop through the $request->get('items') and persist it to DB.

Leave a comment