apie/dateformat-to-regex
Converts PHP date() format strings into “simple” regular expressions for validating date/time strings. Generates regex that matches the format pattern (not full calendar validation, e.g., may accept 30 February). Includes a static DateFormatToRegex::formatToRegex() helper.
date-fns).Executives: "This package lets us validate dates in user inputs or APIs with precision—cutting dev time by 50% while reducing errors. For example, instead of manually writing regex for ISO dates, we’ll auto-generate them. Low risk (MIT license), high reward for compliance-heavy or data-driven products."
Engineering:
"A lightweight PHP library to convert date formats (e.g., DateTime::ATOM) into strict regex patterns. Perfect for Laravel apps needing bulletproof date validation. Trade-off: No localization, but we can extend it if needed. Let’s prototype it for [X feature] and measure dev velocity gains."
Developers: *"Imagine replacing this:
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $date)) { ... }
With this:
$regex = DateFormatToRegex::formatToRegex('Y-m-d');
No more regex headaches—just plug-and-play validation. Works with Laravel’s request validation too!"*
How can I help you explore Laravel packages today?