I would like to delete massively records using the DB facade with a WHERE clause in a classic delete query. I do not want to use the Model Eloquent methods.
A possible way to do it is below
DB::delete('DELETE FROM users WHERE id = ?', [$id]);
echo ("User Record deleted successfully.");
return redirect()->route('users.index');
Question: Is it possible instead of using the primary key $id to use another field which is not the primary key?