Skip to content
Advertisement

How to convert object sent from angular into associative array in laravel?

This is my array request that is received by back-end laravel. I want to insert a bulk of rows. But I should convert it into an associative array. How can I convert my received array data into the format I want.

Array of Objects that I want to convert:

JavaScript

dd($request->all()) gives me below value.

enter image description here

Advertisement

Answer

You can use json_decode for that:

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