laravel-json-api
laravel-json-api copied to clipboard
BroadcastsData::serializeData() does not appear to process $includePaths parameter correctly.
https://github.com/cloudcreativity/laravel-json-api/blob/86e9dbad5df8f077f75f7803fa70e6800d1f113e/src/Broadcasting/BroadcastsData.php#L58
BroadcastsData::serializeData() appears to call Encoder::serializeData(). Encoder::serializeData() does not appear to take a second parameter. And thus no matter if includes are specified or not, the data going down the broadcast wire will have no includes. Below is what BroadcastsData::serializeData() should probably look like.
// BroadcastsData.php
// ...
protected function serializeData($data, $includePaths = null, array $fieldsets = null)
{
$params = new QueryParameters($includePaths ? (array) $includePaths : null, $fieldsets);
return $this->broadcastEncoder()->withEncodingParameters($params)->serializeData($data);
}