/**
  * @param int $id_passos
  * @param array $fields
  */
 public function updateReferenceRows($id_passos, $fields = [])
 {
     $referenceSteps = new ReferenceSteps();
     $referenceSteps->find($id_passos)->delete();
     $reference = new Reference();
     $reference->newSave($fields, $id_passos);
 }
 /**
  * @param Illuminate\Http\Request $request
  * @return Illuminate\Http\JsonResponse
  */
 public function postIndex(Request $request)
 {
     try {
         $flow = new Flow();
         $flow->tipo = $request->input('type');
         $flow->id_revisao = $request->input('useCase');
         $flow->save();
         $id_fluxo = $flow->id_fluxo;
         $step = new Step();
         $step->id_fluxo = $id_fluxo;
         $step->identificador = $request->input('identifier');
         $step->descricao = $request->input('description');
         $step->save();
         $id_passos = $step->id_passos;
         $complementary = new Complementary();
         $complementary->newSave($request->input('complementary', []), $id_passos);
         $business = new Business();
         $business->newSave($request->input('business', []), $id_passos);
         $reference = new Reference();
         $reference->newSave($request->input('reference', []), $id_passos);
         return $this->getJsonResponse($id_passos . ',' . $id_fluxo);
     } catch (\Exception $exception) {
         return $this->getJsonResponse(['data' => $exception->getMessage(), 'error' => true], false);
     }
 }