【发布时间】:2021-01-26 23:37:47
【问题描述】:
当我转储这个Customer::where('email', '=', $inputObj['email']-first(); 时,输出有一些属性。其中一些有#,另一些有+。例如,一个是+exists: true,我可以通过->exists() 访问它,它返回给我true。另一个是#attributes: array:10 [...],我可以看到它是一个关联数组,其值在dump 中,但我不能像->attributes 或像这样['attributes'] 那样访问。不同的符号是什么意思?如何访问 attributes 属性中的值?
我真的很想深入了解正在发生的事情,因此感谢任何有启发性的 cmets (:
【问题讨论】:
-
private或protected属性。