protected function getStatusData($status, $messages = null, $msgKey = 'messages')
	{
		$data = ['status' => $status];

		if ($messages !== null) {
			if ($messages instanceof MessageProviderInterface) {
				$messages = $messages->getMessageBag();
			}

			if ($messages instanceof ArrayableInterface) {
				$messages = $messages->toArray();
			}

			$data[$msgKey] = (array) $messages;
		}

		return $data;
	}