Skip to content

Commit 213e07e

Browse files
Move function withoutTrashed into DatabaseRule (#44938)
1 parent 0a911fe commit 213e07e

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

src/Illuminate/Validation/Rules/DatabaseRule.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ public function whereNotIn($column, $values)
169169
});
170170
}
171171

172+
/**
173+
* Ignore soft deleted models during the existence check.
174+
*
175+
* @param string $deletedAtColumn
176+
* @return $this
177+
*/
178+
public function withoutTrashed($deletedAtColumn = 'deleted_at')
179+
{
180+
$this->whereNull($deletedAtColumn);
181+
182+
return $this;
183+
}
184+
172185
/**
173186
* Register a custom query callback.
174187
*

src/Illuminate/Validation/Rules/Exists.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@ class Exists
88
{
99
use Conditionable, DatabaseRule;
1010

11-
/**
12-
* Ignore soft deleted models during the existence check.
13-
*
14-
* @param string $deletedAtColumn
15-
* @return $this
16-
*/
17-
public function withoutTrashed($deletedAtColumn = 'deleted_at')
18-
{
19-
$this->whereNull($deletedAtColumn);
20-
21-
return $this;
22-
}
23-
2411
/**
2512
* Convert the rule to a validation string.
2613
*

src/Illuminate/Validation/Rules/Unique.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,6 @@ public function ignoreModel($model, $idColumn = null)
5757
return $this;
5858
}
5959

60-
/**
61-
* Ignore soft deleted models during the unique check.
62-
*
63-
* @param string $deletedAtColumn
64-
* @return $this
65-
*/
66-
public function withoutTrashed($deletedAtColumn = 'deleted_at')
67-
{
68-
$this->whereNull($deletedAtColumn);
69-
70-
return $this;
71-
}
72-
7360
/**
7461
* Convert the rule to a validation string.
7562
*

0 commit comments

Comments
 (0)