I have the following array of fields:
$fields = [
'name' => [
'label' => 'Company Name' . $req,
],
'address1' => [
'label' => 'Address' . $req
],
'address2' => [
'label' => 'Address (Line 2)'
],
'zip' => [
'label' => 'Zip/Postal Code'
],
'phone' => [
'label' => 'Office Phone',
'val' => dotted($active->office)
],
[
'type' => 'submit',
'label' => "Save",
'class' => 'btn btn-primary !important'
]
];
I need to validate the field 'phone' to make sure that it is 10 digits, all numbers. What can I add here to check this here, or should I validate it somewhere else?