Skip to content

Commit

Permalink
Merge pull request #47 from Laragear/fix/id-null
Browse files Browse the repository at this point in the history
[3.x] Fixes Rule Unique setting last parameter as not NULL
  • Loading branch information
DarkGhostHunter authored Jul 26, 2024
2 parents 56d5dd0 + 5e06186 commit ccccb37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Rules/RutUnique.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
protected string $numColumn,
protected string $vdColumn,
protected mixed $ignore = null,
protected string $idColumn = 'id'
protected ?string $idColumn = null
) {
$this->table = $table;
}
Expand Down Expand Up @@ -68,7 +68,7 @@ public function __toString(): string
$this->numColumn,
$this->vdColumn,
$this->ignore ? '"'.addslashes((string) $this->ignore).'"' : 'NULL',
$this->idColumn,
$this->ignore ? ($this->idColumn ?? 'id') : 'NULL',
$this->formatWheres()
), ',');
}
Expand Down

0 comments on commit ccccb37

Please sign in to comment.