Skip to content

Solutions #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Task 8: Mass Delete Users
  • Loading branch information
orsisam committed Oct 3, 2024
commit 1523ad78a473676114195acb4a4264a695e9c68a
1 change: 1 addition & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function destroy(Request $request)
// $request->users is an array of IDs, ex. [1, 2, 3]

// Insert Eloquent statement here
User::whereIn('id', $request->users)->delete();

return redirect('/')->with('success', 'Users deleted');
}
Expand Down
Loading