// item表,列new_values数据
{"item_name":"
Chopstick",
"item_quantity":"4",
"item_brand":"d",
"item_serialno":"3",
"item_tag":"New",
"item_categories":"Assets",
"item_unitcost":"4",
"item_depriciation":"5",
"item_location":
"Not Deployed",
"user_assign":"None",
"department":"Not Assigned","id":36}
//控制器
$audits=audits::select('new_values')->get();
//刀片
@foreach($audits as $colName => $value)
{{ $colName }}
@endforeach
答案 0 :(得分:1)
据我了解,您正在使用Audit model package,如果可以,则可以使用此
@foreach($audits as $audit)
@foreach($audit->new_values as $colName => $value)
{{ $colName }}
// use @dd($aud->new_values, $colName) for see what is value
// other logic
@endforeach
@endforeach
答案 1 :(得分:1)
$json = json_decode($aud->new_values);
foreach ($json as $name => $value) {
// Here you have your $name
}