public function student(){
$users=DB::select('select * from details');
return view('welcome',['users'->$users]);
}
@foreach ($users as $user)
<tr>
<td>{{ $user->id }}</td>
<td>{{ $user->email}}</td>
<td>{{ $user->status}}</td>
<td>{{ $user->subject}}</td>
</tr>
@endforeach
1条答案
按热度按时间yebdmbv41#
不要使用原始sql查询代替你可以这样做
或者像这样
然后在你的刀刃上你可以像这样