Skip to content

Commit a9d6e3f

Browse files
committed
add a helper method to check data
1 parent acb87be commit a9d6e3f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/AbstractValidation.php

+15
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,19 @@ public static function makeAndValidate(array $data, array $rules = [], array $tr
8282
{
8383
return new static($data, $rules, $translates, $scene, true);
8484
}
85+
86+
/**
87+
* 创建并且立即开始验证
88+
* @param array $data
89+
* @param array $rules
90+
* @param array $translates
91+
* @param string $scene
92+
* @return static
93+
* @throws \InvalidArgumentException
94+
* @throws \RuntimeException
95+
*/
96+
public static function check(array $data, array $rules = [], array $translates = [], $scene = '')
97+
{
98+
return new static($data, $rules, $translates, $scene, true);
99+
}
85100
}

0 commit comments

Comments
 (0)