我有一个过程,其中一些模型被更新,之后我通过控制板将更新后的对象发送到pusher进行实时跟踪,但该对象有几个其他对象作为关系,因此序列化对象的大小超过了消息的pusher限制大小,因此我的问题是,我如何删除相关对象的一些属性?
我已经尝试过pluck函数,但我不知道如何在neastead对象上使用
$vehicleEntry = VehicleEntry::with('vehicle')->find($request->entryId);
// I need just the id and plate of the object
$vehicleEntry->pluck('vehicle.id', 'vehicle.plate');
但是它得到了错误
{id: 1,车辆:{id: 2,车牌:'JIS575'},created_at:'2019-07-11'}
https://stackoverflow.com/questions/56994826
复制相似问题