for example, the array is like this
$data = [
[
"mobile"=> "1",
"price" => "100.00"
],
[
"mobile"=> "2",
"price" => "500.00"
],
];
one-dimensional array can be verified directly
protected $rule = [
"mobile"=> "require|mobile",
]
but now it is a two-dimensional array, and Tp has custom verification. What you want to verify now is that the mobile phone number in the array must have a value and must be a legal mobile phone number, and the amount must be a positive integer or two digits after the decimal point!
Custom validation:
protected $rule = [
"mobile"=> "require|array|checkMobile",
]
//
protected function checkMobile()
{
//?
//Tp mobile require unique!!!!
}