3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 05:05:26 +00:00

Whoops, used PHP's equal signs instead of MySQL's :/

This commit is contained in:
Brady Wetherington
2025-11-25 20:23:15 +00:00
parent 9b8768dbdd
commit c6c0a14ee0

View File

@ -42,11 +42,11 @@ class UniqueUndeleted implements ValidationRule, ValidatorAwareRule
public function validate(string $attribute, mixed $value, Closure $fail): void
{
$query = DB::table($this->table)->whereNull('deleted_at');
$query->where($this->columns[0], '==', $value); //the first column to check
$query->where($this->columns[0], '=', $value); //the first column to check
$translation_string = 'validation.unique_undeleted'; //the normal validation string for a single-column check
foreach (array_slice($this->columns, 1) as $column) {
$translation_string = 'validation.two_column_unique_undeleted';
$query->where($column, '==', $this->data[$column]);
$query->where($column, '=', $this->data[$column]);
}
if ($query->count() > 0) {