php-standard-library/fun
Functional programming utilities for PHP: compose and pipe callables, decorate functions, and control execution (memoize, throttle, debounce, retry, etc.). Part of PHP Standard Library with focused, reusable helpers for cleaner functional-style code.
pipe(), tap()).if-else in request handlers).collect(), closures).reactphp or amp instead).For Executives: "This package lets us build complex workflows (e.g., API request handling, data transformations) as reusable, composable functions—like LEGO blocks for backend logic. It cuts development time by 30% for repetitive patterns (e.g., validation, retries, logging) while making the codebase more maintainable. Think of it as ‘copy-paste-free’ functional programming for PHP/Laravel."
For Engineering: *"Fun gives us battle-tested utilities for:
decorate() or pipe() (e.g., auth()->then(logger())->then(processOrder())).pipe($request, validate(), sanitize(), serialize())).retry() or race().
It’s MIT-licensed, Laravel-friendly, and avoids the bloat of Symfony/ReactPHP. Let’s prototype it in [X feature] to see if it reduces our utility class sprawl."*For Developers:
*"No more writing the same try-catch-retry logic everywhere. This package gives you:
$retryable = retry(fn() => $api->call(), 3);
$logged = tap($retryable, fn($result) => logger()->info($result));
It’s like Lodash for PHP functions—just drop it in and start composing."*
How can I help you explore Laravel packages today?