[Vuejs]-Want to update array values in vuejs using laravel

0๐Ÿ‘

i figure out my problem with this function

public function update(Request $request, $id)
{
  $collection = $request->all();
  for ($i = 0; $i < count($collection); $i++) {
     Job::where('id', $collection[$i]['id'])
     ->update([
          'position' => $collection[$i]['position'],
          'address' => $collection[$i]['address']
        ]);
    }
    return response()->json(['collection' => $collection]);
}

Leave a comment