在我的Laravel5.4型号之一上,我有多个登录器。像这样:publicfunctiongetRevenueAttribute(){return$this->calculate()->revenue($this->price,$this->amount);}问题是,当我将模型传递给我的Vue组件时:product.revenue不存在。有没有办法实现这一目标?我不想再次计算这些东西。非常感谢。看答案您需要添加一个appends归因于您的模型这个有关更多信息。/***Theaccessorstoappendtothemodel'sarrayform.**@vararray*/protected