Delete functionality for single and multiple records
I use the destroy() method when deleting single and multiple records. I just want to know if I am using a good approach to handle these both actions in one method or should I create another method like destroyMany() to handle bulk delete? I am passing '/departments/delete/1,2,3' for multiple and '/departments/delete/1' for a single record. Are there also any possible complications if I do this?
public function destroy($id) {
Department::destroy(explode(",", $id));
return response()->json([ "message" => "Deleted successfully", "status" => 200 ]);
}