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;
	}
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;
	}
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 ; }
Get an array of a status message response.

@param  string $status
@param  mixed  $messages optional
@param  string $msgKey   optional

@return array
Get an array of a status message response .