我正在尝试在我的laravel
应用程序中获取带连字符的列值。但我无法得到它。
$result->reference
这工作正常。
但是当我尝试$result->product-id
它返回
未定义的属性:标准类::$product
当我尝试$result->{'product-id'}
类 stdClass 的对象无法转换为字符串
如何获取此值?
这应该有效:
$result->getAttribute('product-id');
我正在尝试在我的laravel
应用程序中获取带连字符的列值。但我无法得到它。
$result->reference
这工作正常。
但是当我尝试$result->product-id
它返回
未定义的属性:标准类::$product
当我尝试$result->{'product-id'}
类 stdClass 的对象无法转换为字符串
如何获取此值?
这应该有效:
$result->getAttribute('product-id');