[Vuejs]-Laravel Array to string conversion on multiple records

0๐Ÿ‘

You need to format your $data to be like this.

[
  [
    'property_type_id' => 2,
    'fee_amount' => "123"
  ],
  [
    'property_type_id' => 1,
    'fee_amount' => "1312"
  ],
]

0๐Ÿ‘

In this case, if the data structure of the $request->feeByPropertyType data structure matches with the database tables structure, then you can simply use DB facade to insert multiple rows at once.

DB::insert($request->feeByPropertyType);

Leave a comment