Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phunctional Laravel Package

lambdish/phunctional

lambdish/phunctional is a functional programming toolkit for PHP and Laravel. It offers immutable collections, Option and Either types, currying, function composition, memoization, and pipeline helpers, making it easier to write expressive, side-effect-aware code without leaving familiar PHP.

Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for a functional utility layer. Instead of every team hand-rolling curry, compose, pipe, map/filter/reduce helpers, this package sets one small, MIT-licensed baseline. The decision it forces is: do we own this code, or depend on it? (Here, the honest answer may be "vendor a copy and own it.")
  • Depth of functional-programming adoption. Adopting it is a statement that composition/partial application is a first-class style in at least some bounded contexts — data transformation pipelines, reporting, validation chains, middleware — without committing to a large FP framework.
  • Roadmap shape for refactors. If a team picks this up, it implicitly favors incremental, in-place refactors of imperative loops into pipelines over a rewrite into a new architecture. That is a roadmap sequencing decision, not just a library choice.
  • Engineering standards and review policy. It creates a shared vocabulary (point-free style, currying, composition) that must be reflected in style guides, lint rules, and code-review expectations, or it becomes a readability tax.
  • Supply-chain and platform risk register. Last release 2020-09-18, ~360 GitHub stars, no visible release cadence. This drives an explicit maintain / fork / avoid decision and a PHP-version upgrade-planning item (PHP 8.x compatibility needs verification, not assumption).
  • Use cases it plausibly serves: transformation pipelines in service classes, config composition, event-handler chains, cleaning up deeply nested closures in reporting/export code, and any hot path where a heavier abstraction (e.g., fluent collection layers) is more overhead than the team needs.

When to Consider This Package

Consider it when:

  • The team already reaches for array_map / array_filter and wants composition and currying in plain PHP without adopting a full FP framework.
  • You need only a handful of primitives. The small API surface is genuinely easy to audit, and the MIT license plus small footprint keeps lock-in low.
  • Performance matters and a lightweight dependency beats a heavier, feature-rich collection library on the hot path.
  • Adoption is scoped — one service, one module, one refactor — where you can time-box a pilot and measure readability, not a platform-wide mandate.
  • You are comfortable forking or vendoring. At this release cadence, treat the package as source you may inherit rather than a vendor you can lean on.

Look elsewhere when:

  • PHP 8.1/8.2/8.3+ is required and compatibility is unverified. A library with no release since 2020 is a real risk for deprecations, dynamic properties, and static-analysis cleanliness under PHPStan/Psalm at strict levels.
  • Your governance requires active maintenance, a security-response path, or a healthy contributor base. Low stars and a stale release history mean a low bus factor; assume you may become the maintainer.
  • The team is junior or unfamiliar with FP. Curried, point-free code produces stack traces and diffs that are harder to onboard into; that cost is real and should be weighed, not waved away.
  • Laravel Collections already cover the need. Introducing a second collection/transformation abstraction in the same codebase creates two dialects for the same job.
  • You need lazy evaluation, generators, type-safe generics, or static guarantees — evaluate azjezz/psl, loophp/collection, functional-php, or plain illuminate/support first.
  • The dependency would be load-bearing across many services. The blast radius of an unmaintained library scales faster than the convenience it delivers.

How to Pitch It (Stakeholders)

For executives: This is a small, MIT-licensed helper library that makes PHP data-transformation code shorter and easier to test, with essentially no licensing cost and minimal lock-in. The tradeoff is maturity: it has not had a release since 2020 and is a low-profile open-source project. My recommendation is therefore a time-boxed pilot in a single service, not a platform-wide standard. We cap our exposure, prove the readability and performance benefit, and if it earns its place we vendor a copy and own it ourselves. Cost is measured in engineering hours, not license fees, and the downside is bounded.

For engineering: It gives us curry, compose, pipe, and lightweight map/filter/reduce semantics in pure PHP, focused on simplicity and speed. It complements Laravel rather than replacing Collections — we would use it where the fluent collection layer is more machinery than we need, particularly in transformation pipelines and export/reporting code. Two things need to be true before we commit: (1) a half-day of compatibility verification against our target PHP version, with a PHPStan/Psalm baseline, and (2) a short internal style note on when point-free code is appropriate so reviewers and new hires are not decoding nested closures. The codebase is small enough to fork if the upstream project stays dormant — that is a contingency we should plan for, not be surprised by.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels