/** * @inheritdoc */ public function resourceInvalidAttributesMessages(MessageBag $messageBag, $attributePrefix = null, $statusCode = self::STATUS_INVALID_ATTRIBUTES) { $prototype = $this->repository->error(self::RESOURCE_INVALID_ATTRIBUTES_MESSAGES); $prototype = Error::cast($prototype)->setStatus($statusCode); $prefix = $attributePrefix ? P::attribute($attributePrefix) : P::attributes(); $errors = new ErrorBag($messageBag, $prototype, $prefix); return $errors->toArray(); }