use App\Models\YourModel;
class YourController extends Controller
{
public function deleteRecords()
{
// Define your two conditions
$condition1 = 'your_first_condition';
$condition2 = 'your_second_condition';
// Delete records that meet both conditions
YourModel::where('column1', '=', $condition1)
->where('column2', '=', $condition2)
->delete();
return response()->json(['message' => 'Records deleted successfully']);
}
}
1条答案
按热度按时间42fyovps1#
您可以尝试:
字符串