I figured that the right approach is the following:
Before the AXIOS call, apply JSON.stringify()
to the array of objects.
'myParam': JSON.stringify(arrayOfObjects) // this will be the param sent from Axios
Then on the PHP side, when you intercept the POST, use json_decode()
to turn the string into the original array of object.
json_decode($request->all()['myParam']
Clean and effective.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…