Skip to content

Commit a76b08d

Browse files
Add ability to pass accepted values as argument list
1 parent 6f2f8e6 commit a76b08d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Illuminate/Validation/Rule.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,26 @@ public static function exists($table, $column = 'NULL')
3434
/**
3535
* Get an in constraint builder instance.
3636
*
37-
* @param array $values
37+
* @param array|string $values
3838
* @return \Illuminate\Validation\Rules\In
3939
*/
40-
public static function in(array $values)
40+
public static function in($values)
4141
{
42+
$values = is_array($values) ? $values : func_get_args();
43+
4244
return new Rules\In($values);
4345
}
4446

4547
/**
4648
* Get a not_in constraint builder instance.
4749
*
48-
* @param array $values
50+
* @param array|string $values
4951
* @return \Illuminate\Validation\Rules\NotIn
5052
*/
51-
public static function notIn(array $values)
53+
public static function notIn($values)
5254
{
55+
$values = is_array($values) ? $values : func_get_args();
56+
5357
return new Rules\NotIn($values);
5458
}
5559

0 commit comments

Comments
 (0)