$data]; } public function item($resourceKey, array $data) { if ($resourceKey == null) { return $data; } return [$resourceKey ?: 'data' => $data]; } }