Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

danny620's avatar

Mobile Phone Validation UK

Hi,

I'm wanting to create a custome validation rule that can validate a UK mobile number I want the validation to valid a uk number but also if a user enters it in like 0796422442 or 44796422442 they before validate but i want the format to also save in 44796422442 with the (44) at the start, can anyone help me on this?

0 likes
5 replies
Snapey's avatar

I use propaganistas/laravel-phone and it accepts 44796422442

'phone' => 'max:20|phone:GB,mobile,fixed_line',
1 like
danny620's avatar

I don't really want to use a package if i can help it.

danny620's avatar

How can I validate just numbers with no spaces or ()

Snapey's avatar

Alter the regex or search for a different one ?

Please or to participate in this conversation.