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

Conditional Laravel Package

omitobisam/conditional

Conditional is a Laravel package for expressive conditional validation. It lets you apply rules only when specified conditions are met, keeping complex form request logic readable, reusable, and easy to maintain.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. omitobisam/conditional remains a single-purpose utility package that replaces branch-heavy or nested ternaries with a fluent, chainable conditional API. It is framework-agnostic rather than a Laravel-specific extension, so it slots into any Composer-managed PHP application (Laravel, Lumen, Symfony, plain PHP) without requiring a service provider, facade, config file, or migrations. For a TPM, this is still the lowest-risk architectural category: a leaf dependency with no transitive weight and no infrastructure footprint. The trade-off is unchanged — no leverage, no framework integration benefit, no ecosystem gravity. It is a readability sugar library, not a platform component. The 2.0.0 release does not alter the architecture; it alters the maintenance signal around it.

Integration feasibility. Mechanically trivial: a single composer require omitobisam/conditional, a use statement, and the fluent chain in application code. No bootstrapping, no published config, no runtime coupling to Laravel internals. The real feasibility question remains compatibility, and 2.0.0 sharpens it rather than resolving it. A major version bump means, by SemVer convention, that public API surface changed in a backward-incompatible way — and the published release notes contain no changelog detail, no migration guide, no list of removed or renamed methods. The notes reference only branch/CI housekeeping (1.x -> master, a new php.yml workflow, a 2.x branch). That is an unusually thin disclosure for a major release and it is now the single largest unknown in the adoption decision.

Technical risk. Blast radius is still small — if the package breaks or is abandoned, it can be removed or reimplemented locally in an afternoon. But the risk profile has shifted in two directions at once:

  • Positive: CI hygiene improved. The new php.yml GitHub Actions workflow (PR #54) is direct evidence of continuous integration that was previously absent. This partially closes the "no CI evidence surfaced" gap flagged in the prior assessment. It also suggests the maintainer is modernizing tooling off Travis, which historically correlates with current-PHP support. It does not prove a multi-version test matrix — a single-workflow file tells us CI runs, not what it covers.
  • Negative: a major bump with no migration guidance. 2.0.0 is a breaking release by definition. Without a documented changelog, you cannot estimate the rewrite cost of any existing usage, and you cannot tell whether 1.x is now end-of-life. For a package with zero dependents and no community validation, there is no crowd-sourced upgrade path — you will be the first to discover the breaks.
  • Bus factor 1 — unchanged. One maintainer, ~43 stars, no dependents. The 2.0.0 release is evidence the maintainer is currently active, which is a meaningful improvement over an 18-month-silent project, but a single burst of activity is not a support commitment. Activity is not the same as durability.
  • Value overlap — unchanged. Laravel ships Conditionable and global when()/unless(); PHP 8+ has match. Adoption still needs a specific justification (fluent chains inside builder pipelines), not a general "cleaner ifs" argument. Note that 2.0.0 may have reduced the gap the package fills, but without release notes we cannot tell whether the major bump was a PHP-version floor raise, an API redesign, or both.
  • Behavioral edge cases — unchanged and now harder to assess. Fluent conditional libraries have subtle semantics around null handling, closure evaluation timing (lazy vs. eager), and chained else fallbacks. If 2.0.0 changed any of these, it is precisely the class of change that a terse release note would omit and that would silently alter production behavior.
  • Debuggability — unchanged. Fluent chains produce harder-to-read stack traces than plain if/else, raising incident cost in the paths where they are used.
  • Version drift — partially mitigated, newly ambiguous. Active CI reduces the odds the package stops accepting current PHP before your app does. But a major version boundary is exactly where a maintainer drops an EOL PHP floor. You now have two candidate lines (1.x, 2.x) and no stated support policy for either.

Key questions to resolve before adoption.

  1. What actually changed in 2.0.0? Obtain the real diff or changelog — removed/renamed methods, changed closure evaluation semantics, PHP floor raise. Do not accept branch-housekeeping notes as a changelog.
  2. Is 1.x now EOL, and will it receive security or compatibility fixes? This determines whether adopting 1.x is a dead end.
  3. What PHP versions does 2.0.0 support, and does the new php.yml workflow test across a matrix (or only a single version)?
  4. Does the package ship a Laravel service provider, and if so, is it auto-discovered or opt-in?
  5. What is the test coverage behind the CI run — is behavior pinned by tests we can trust, or is CI only a lint/syntax gate?
  6. What is the semantic behavior for nulls, falsy values, and closures in 2.0.0 — eager or lazy, and did it change from 1.x?
  7. Can the same outcome be achieved with Laravel's when()/Conditionable or PHP 8 match with less dependency risk?
  8. Is there now a documented support window or BC policy, or is the branch split (1.x / 2.x) purely ad hoc?

Integration Approach

Stack fit. Unchanged. The package fits any PHP 8+ / Composer stack and is effectively invisible to the rest of the architecture. It is not Laravel-native (no config publishing, facades, or container bindings), so it can be adopted identically in a Laravel monolith, a Lumen microservice, a package library, or a legacy PHP app. It will not conflict with Laravel's Conditionable trait, but teams should pick one convention per codebase to avoid two competing syntaxes for the same concept.

Version targeting — new decision point. The prior assessment's implicit "take the latest release" assumption no longer holds cleanly. Two defensible positions:

  • Target 2.x if the PHP floor matches your runtime and you can obtain the breaking-change list. Preferred for anything greenfield, because 1.x may be unsupported.
  • Target 1.x only if 2.x raises the PHP floor past your runtime and 1.x is confirmed to remain patched. If 1.x is EOL, do not adopt it at all — reimplement locally instead.

In both cases, do not use --ignore-platform-reqs to force an install.

Migration path. Still additive and coexistent with native conditionals, with one added step for the major version:

  1. Resolve the 2.0.0 changelog first. This is now step zero and can invalidate everything downstream. Timebox it — if no authoritative diff exists after a short investigation, treat that as a negative signal rather than chasing the maintainer.
  2. Prove the value. Identify the specific pattern it improves (long if/elseif/else chains assigning a value, nested ternaries in builders). If no such pattern exists, do not adopt.
  3. Wrap it. Introduce a thin project-level helper or base class that calls the package so application code depends on your abstraction, not the vendor. This converts vendor risk — including future major bumps — into a one-file swap. Given the 2.0.0 precedent, this step has moved from "nice to have" to effectively mandatory.
  4. Pilot in one bounded module — ideally non-critical-path code — and measure readability in review, not runtime.
  5. Standardize or drop via the team style guide.

Compatibility. Verify four things concretely before merging: the php constraint in 2.0.0's composer.json covers your runtime; the breaking-change list (once obtained) does not touch the APIs in your pilot; the package pulls no transitive dependency that conflicts with your lockfile; autoloading is PSR-4 clean. Add a fifth for this release specifically: confirm your Composer constraint is pinned to ^2.0 (or ^1.3 deliberately) so an unplanned major cannot land via composer update.

Sequencing. 2.0.0 changelog investigation → dependency audit → local proof-of-concept in a feature branch → abstraction wrapper → pilot in one module → team review → document convention or remove. The 1.x→2.x transition demonstrates that this dependency will have major-version churn, which strengthens the case for treating adoption as a timeboxed experiment with a pre-built exit rather than a committed platform decision.

Operational Impact

Maintenance. Code-level maintenance remains near-zero (static utility, tiny surface). Dependency maintenance is the real cost and has become slightly more complex: there are now two active lines and an undocumented breaking change to absorb. The upside is a maintainer who is visibly working on the project (new CI, branch restructuring) — the downside is that you must now track that work rather than assume stasis. Budget for one of two outcomes, unchanged: (a) fork and vendor internally, or (b) reimplement the ~100–200 lines as an internal helper. MIT licensing leaves both legally unencumbered. The wrapper approach in the integration section is what makes either exit cheap.

Support. Still no commercial support, no SLA, no meaningful community forum; burden falls entirely on the adopting team. The 2.0.0 release adds a new support consideration: an undocumented major version is a support cost in itself. Absorbing it will consume engineering time that a documented release would not have. For anything customer-facing or regulated, continue to treat this as "vendored code we happen to install via Composer," not a supported dependency.

Scaling. Runtime scaling remains a non-issue — function calls and closures, no I/O, no caching, no memory growth. Organizational scaling remains the concern: every additional developer and codebase adopting the fluent style multiplies review surface and drift risk. Standardize early.

Failure modes to plan for.

  • Silent breaking change on upgrade (new, elevated). A 2.x minor release introduces a further BC break that the thin changelog practice does not surface, and composer update pulls it in. Detection is a green-to-red test suite or a production anomaly; mitigation is a pinned constraint plus the wrapper plus targeted tests at every adoption site.
  • Major-version churn without migration guides (new). Each future major costs an unbudgeted investigation cycle. Mitigation is the wrapper and an explicit policy that the team absorbs majors on its own schedule, not Composer's.
  • Abandonment / PHP drift. Unchanged in kind, reduced in probability by the new CI workflow — but a burst of activity is not a commitment, and the project could go quiet again after 2.0.0 ships.
  • Semantic surprises. Lazy vs. eager evaluation or null-handling differences cause a production bug that reads as correct in review. Higher risk in 2.0.0 specifically, since a major bump is where such semantics change.
  • Dependency conflict. Low probability given the small footprint; document the escape hatch before it is needed.
  • Debugging friction. Fluent chains obscure stack traces in incident response; limit adoption to non-critical paths or value-assignment branches.
  • Two-syntax codebase. Most likely operational failure, entirely preventable through a written convention.

Ramp-up. Learning cost is still minimal — under an hour for an experienced PHP developer, documented by a single code example. The 2.0.0 release does not change the onboarding cost of the library; it changes the onboarding cost of the dependency decision, because a TPM now has to spend real time establishing what version to standardize on and what changed. The honest position is unchanged in direction but firmer in degree: this is a micro-optimization with a small but non-zero dependency tail, and 2.0.0 has just demonstrated that the tail has maintenance events attached to it. Worth a timeboxed pilot in a codebase with a genuine nested-ternary problem, gated on obtaining the 2.0.0 changelog — still not worth a default-in-every-project decision.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console