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

1
  • 2
    please add your code.. Commented Nov 4, 2019 at 12:45

2 Answers 2

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();
}
Sign up to request clarification or add additional context in comments.

1 Comment

your deleteRecords function working fine but the updateRecords not working any other idea for that
0

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

Hope it helps. Cheers!

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.