getOrderId())->firstOrFail(); if($packingList->confirmed) { $this->completeStep($order, $step); return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED); } return new JsonResponse(['message' => 'Failed to update order step because packing list is in complete'], HttpStatus::VALIDATION_FAILED); } catch (\Exception $exception) { throw new InternalServerErrorException("Failed to update order step because {$exception->getMessage()}"); } } }