慕粉3181110
2016-09-14 12:51
public function create() {
$users = DB::connection('pgsql')->select('select * from test01');
//$data=array();
return view('demo',['data'=>$users]);
}
<div>
@foreach($data as $datas)
<li>{{ $data->id }}</li>
@endforeach
</div>
按照你命名继续错下去应该这么写
<div>
@foreach($data as $datas)
<li>{{ $datas->id }}</li>
@endforeach
</div>
首先 你的foreach循环里代码有问题,@foreach($data as $datas)
<li>{{ $data->id }}</li>
@endforeach
轻松学会Laravel-表单篇
32653 学习 · 255 问题
相似问题