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

nulele's avatar

Laravel 5 localized date validation

Hello,

I need to validate this date format ddd DD/MM/YYYY HH:mm where ddd is a non English day of week string.

Since the date_format validator doesn't work, I used a custom Rule with Carbon hasFormat function but it only works with English format.

I've done it only with createFromLocaleIsoFormat by catching the InvalidArgumentException exception.

Any other idea?

Thanks

0 likes
1 reply
bobbybouwmann's avatar

You can probably split the incoming string by each space and validate each parts separately using Carbon. It's not ideal, but it's something!

Please or to participate in this conversation.