~~~php
class MyModel extends Model
{
public $arrayAttribute = [];
public function rules()
{
return [
checks if every category ID is an integer
['categoryIDs', 'each', 'rule' => ['integer']],
]
}
}
~~~
> Note: This validator will not work with inline validation rules.