Skip to content

Commit 6578b7c

Browse files
Adds validateNotStartsWith function
1 parent f2fad10 commit 6578b7c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,6 +1949,19 @@ public function validateStartsWith($attribute, $value, $parameters)
19491949
{
19501950
return Str::startsWith($value, $parameters);
19511951
}
1952+
1953+
/**
1954+
* Validate the attribute not starts with a given substring.
1955+
*
1956+
* @param string $attribute
1957+
* @param mixed $value
1958+
* @param array<int, int|string> $parameters
1959+
* @return bool
1960+
*/
1961+
public function validateNotStartsWith($attribute, $value, $parameters)
1962+
{
1963+
return ! Str::startsWith($value, $parameters);
1964+
}
19521965

19531966
/**
19541967
* Validate the attribute ends with a given substring.

0 commit comments

Comments
 (0)