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

AbdallahSabri's avatar

How to validate double values?

How can I check (validate) if the given value is numeric and (DOUBLE).

In laravel request validation there is a lot of methods to check numbers and and dates.

0 likes
4 replies
martinbean's avatar
Level 80

@AbdallahSabri Just use numeric. A double is a numerical value.

If you need to do anything more specific, you can check the format using a regex validation rule.

6 likes
newbie360's avatar
'cloumn' => 'required|regex:/^\d+(\.\d{1,2})?$/',

Please or to participate in this conversation.