我的控制器中有一個代碼,它根據條件從數據庫中獲取數據。我想回顯數組中項目的索引public function history($id){ $msg= whatsapp::where('claim_id', $id)->get(); return view('history', compact(['msg''])); }下面是我的每個循環。@foreach($msg as $msg) <tr> <td>{{$msg->id}}</td> <td>{{$msg->created_at}}</td> <td>{{$msg->tel}}</td> <td>{{$msg->message}} <br>{{$msg->files}}</td>> </tr>@endforeach無論消息的 id 是什么,我都希望 numberint 從 1 開始。
我想重新啟動從數據庫中獲取的多個數據的 id
慕田峪9158850
2022-12-23 15:08:44