0

I want to update multiple records statuses or delete.

Status is: accept, reject, pending.

so want to give checkbox to the user for select multiple records and dropdown for choose status want to update records at a time,

and also want to give the delete option on the dropdown to delete mass records at a time

itxrahulsingh
  • 53
  • 1
  • 11

2 Answers2

1
public function updateRecords(Request $request) {
   $recordIds = $request->get('recordIds');
   $newStatus = $request->get('newStatus');
   RecordModel::whereIn('id', $recordIds)->update(['status' => $newStatus]);
}
public function deleteRecords(Request $request) {
   $recordIds = $request->get('recordIds');
   RecordModel::whereIn('id', $recordIds)->delete();
}
George
  • 301
  • 2
  • 4
0

I answered a similar question few days back. Look Update status of each dynamic row using checkbox.

Hope it helps. Cheers!

Digvijay
  • 7,836
  • 3
  • 32
  • 53
  • its working Good but if i select accept in select option so all row status update to accept, Same for reject how to do that – itxrahulsingh Nov 04 '19 at 13:50