我试图显示 json 响应 的值。当我在刀片视图内dd时,它工作得很好,但当我试图在桌子上显示时,它返回错误,这是@php dd( $user->irel__com_access_level->ID); @endphp
尝试获取非对象的属性
我的代码显示在表格中
@foreach($content as $user)
<td>{{ $user->irel__com_access_level->ID }}</td>
@endforeach
这是我的 json 响应 ....我想显示irel__com_access_level内部的ID
{
"data": [
{
{
"ID": "banana",
"PWD": "W6ph5Mm5Pz8GgiULbPgzG37mj9g=",
"NICK_NAME": "BANANA NANA NA",
"PWD_INVALID_HIT": "0",
"PWD_CREATE_DT": "2019/09/06 16:44:40",
"INSTITUTION_ID": "C01",
"ACL_ID": "L03",
"LOGIN_DT": " ",
"LOGIN_STS_ID": "N",
"STS_ID": "C03",
"TYPE_ID": "U00",
"UPD_ID": "asmidah",
"UPD_DT": "2019/09/06 16:44:40",
"EMAIL_ID": "banana@gmail.com",
"PHONE_NO_ID": "0",
"HP_ID": "0101234567 ",
"CRT_DATE_DELETED": "2019/09/06 16:44:40",
"irel__com_access_level": {
"ID": "L03", // i want to display this
"DESCRIPTION": "2NDLEVEL",
"IS_CREATE": "N",
"IS_READ": "Y",
"IS_UPDATE": "Y",
"IS_DELETE": "N",
"STS_ID": "R01",
"UPD_ID": "shukrimb",
"UPD_DT": "2012/09/13 13:28:25"
}
我的控制器
private $client;
public function __construct(){
$this->client = new Client(['base_uri' => 'http://172.19.52.6/api/configuration/getUserIndex']);
}
public function index()
{
$response = $this->client->get('getUserIndex');
$content = json_decode($response->getBody());
return view('configuration.comuserprofiles.ComUserProfilesList', ['content' => $content->data]);
我想在json响应中显示irel__com_access_level内部的ID
MYYA
慕尼黑8549860