我有一个包含列'事务'的数据库表。包含对象值。
在视图文件中,dd($ receipts->事务)是: -
"{"cancelled":"0","hash":"5a3ecdf73225d","order_id":"134","tx_date":"24-December-2017 00:43:45","tx_amt":"180.0000","Result":"CAPTURED","PaymentID":"3031646430073580","PostDate":"1224","TranID":"6582408430073580","Auth":"657402","Ref":"735800425124","tx_id":"1781","tx_mode":"KNET","tx_status":""}"
当我尝试打印tx_date时 - > {{$ receipts->交易 - > tx_date}}
给出错误: 试图获得非对象的属性
我尝试了以下内容:
@php
$receipts->transaction = (object) $receipts->transaction;
@endphp
然后 {{$ receipts->交易 - > tx_date}}
答案 0 :(得分:0)
而不是:
$receipts->transaction->tx_date
使用:
$receipts->transaction['tx_date']