Skip to content
Advertisement

Store array from vuejs into a SQL column json but store null

I created a form that will save data in my users column of my table pack.

My form data is stored in my user variable. During my axios request, I push the data from the user variable into my users variable which is an empty array.

The data stores well in my users variable which is an array.

Then, I store my users variable in my users column which is in my table pack, but the result returned is NULL each time.

JavaScript
JavaScript
JavaScript
JavaScript

Advertisement

Answer

It better you insert one per time, i think. So,

JavaScript

But if you wanna insert it all every time you click the button, you can do that

JavaScript

Try to see what appears using dd($request[‘users’]) in the method

See more

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement