Php 使用update Laravel组合时获取索引
我需要你的帮助来获取$index,它是更新循环函数的id索引,有什么方法可以检索到它吗?非常感谢您的帮助。您为什么要使用Where。我想你应该用where。或者您甚至可以使用findbe,因为$request->input('id')是一个数组,所以我应该使用where inPhp 使用update Laravel组合时获取索引,php,laravel,eloquent,Php,Laravel,Eloquent,我需要你的帮助来获取$index,它是更新循环函数的id索引,有什么方法可以检索到它吗?非常感谢您的帮助。您为什么要使用Where。我想你应该用where。或者您甚至可以使用findbe,因为$request->input('id')是一个数组,所以我应该使用where in Asset_component::whereIn('id', $request->input('id'))->update(array( 'asset_status_id' =>
Asset_component::whereIn('id', $request->input('id'))->update(array(
'asset_status_id' => Asset_status::whereName('Waiting for transfer')->first()->id,
'technician_id' => $request->input('technician'),
'lab_id' => Asset_component::find($index)->asset->lab->id,
'office_id' => Asset_component::find($index)->asset->office->id,
'require_date' => Carbon::createFromFormat('m/d/Y', $request->input('require_date')),
'comment' => $request->input('comment'),
'warehouse_id' => null
));