withMessageTranslation('validationFailure', null, [ 'field' => $field, 'type' => $type, ]) ->encode() ); $exception->entityType = $entityType; $exception->field = $field; $exception->type = $type; return $exception; } public function getEntityType(): string { if (!$this->entityType) { throw new LogicException(); } return $this->entityType; } public function getField(): string { if (!$this->field) { throw new LogicException(); } return $this->field; } public function getType(): string { if (!$this->type) { throw new LogicException(); } return $this->type; } }