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

The Lost Functions Laravel Package

jawira/the-lost-functions

Jawira's The Lost Functions is a lightweight PHP utility library that fills gaps in the standard library with simple, dependency-free helpers for common array, string, and value operations. Drop-in functions for cleaner, more expressive PHP code, with namespaced, reusable helpers designed for modern...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What this actually is. jawira/the-lost-functions is a framework-agnostic Composer library of standalone PHP convenience functions (string, array, and general-purpose helpers) autoloaded via the files directive. It is not a Laravel package: there is no service provider, no facade, no config file, no publishable assets, and no package-discovery metadata. From a TPM's seat, that framing matters more than the function list — this is a utility dependency, not a framework integration.

Architecture fit. It can only ever occupy the lowest layer of the stack — a pure helper namespace sitting beneath the domain layer. That gives it a genuinely small blast radius (it cannot touch the container, the request lifecycle, Eloquent, or queues), which is a real architectural positive. The negative is governance: because nothing registers it, there is no natural discovery point. A future engineer will find these functions in the codebase with no signal that they came from a third-party dependency, no version constraint visible at the call site, and no upgrade hook. The architectural question is not "does it fit?" — it fits anywhere, trivially — but "does it occupy a slot we already own?" Laravel ships Illuminate\Support\Str, Illuminate\Support\Arr, and a large set of global helpers that cover most of this ground; if the overlap is high, we are adding a dependency, a symbol namespace, and a second idiom for operations we already have one idiom for, in exchange for near-zero capability gain.

Integration feasibility. Technically trivial — one composer require and it works. Feasibility is therefore not the constraint. The constraints are trust and long-term ownership, both of which are weak signals here: zero stars, zero dependents, and a score of 0 mean there is essentially no external evidence of production use, no ecosystem pressure to keep it healthy, and no crowd-sourced bug discovery. Treat the absence of dependents as the headline risk, not a footnote.

Technical risk.

  • Supply chain / bus factor. Single-maintainer, hobby-scale project. Low release cadence is the expected steady state.
  • Symbol surface. Autoloading raw functions means every function is a new global or semi-global symbol. A name collision produces Cannot redeclare function — a fatal, uncatchable error at boot that takes the entire application down, not just one code path. Collision risk against Laravel's own global helpers is non-zero.
  • BC exposure. The API surface is a long list of one-line functions; each one is an independent breaking-change vector, and there is no facade or class to version behind.
  • Tooling friction. files-autoloaded functions are historically awkward for static analysers, IDEs, and opcache.preload setups unless stubs are shipped.
  • Runtime drift. The binding constraint is the PHP version matrix, not the Laravel version — and an abandoned package will not be patched for a future PHP deprecation.

Key questions to put to the maintainer (or answer internally).

  1. Are the functions namespaced, and is the namespace stable across majors?
  2. Which PHP versions are supported, tested in CI, and covered by a declared matrix?
  3. Is there a test suite with meaningful coverage, and does it run on every commit?
  4. What is the license, and is it compatible with our distribution model?
  5. Is there a security contact or advisory process?
  6. Precisely which functions do we need that Str/Arr/our own App\Support do not already provide? Name them. If the answer is fewer than five, this is not a dependency decision.
  7. Does documentation specify behaviour for null, empty string, and multibyte/unicode inputs?
  8. Can we fork it under our own organisation without friction if needed?

Integration Approach

Stack fit. Because the package never touches framework internals, it is in principle compatible with any Laravel version from 5.x through 11.x. This collapses the usual two-dimensional compatibility matrix (Laravel version × PHP version) into one dimension (PHP version), which is a genuine simplification and the strongest argument in its favour. There is no service provider to conflict, no config to publish, no publish tags to manage.

Migration path. There is nothing to migrate — the change is purely additive and reversible in one composer remove. Reframe the work as an adoption decision with a gap analysis, not a migration:

  1. Sandbox spike. Install on a throwaway branch. Run the full test suite, the static analyser, and a get_defined_functions() diff before/after to enumerate exactly what symbols land in the runtime.
  2. Gap analysis. For each candidate function, map it to an existing Illuminate\Support\Str/Arr equivalent or an in-repo helper. Keep only the residual — the set with no existing equivalent.
  3. Decision record. If the residual is small and unremarkable, do not adopt; write the ADR so the next person doesn't re-litigate it. If the residual is material, proceed.
  4. Isolate. If adopted, never call the package directly from application or domain code. Wrap the functions we actually use behind our own App\Support class or namespaced functions so that removal or replacement is a single-file change. This also gives us a place to pin behaviour with tests.
  5. Pin hard. Exact version or commit SHA — not a caret range. A library with no dependents and no release cadence gives us no reason to accept automatic minor upgrades.
  6. Characterization tests. For each function we depend on, write a test asserting the behaviour we rely on, including null/empty/unicode edges. That test is what protects us from a silent semantic change or a fork.
  7. Sequencing. Roll out to one bounded module first, behind the wrapper, and only broaden if it survives a release cycle. Re-evaluate the whole decision at the next PHP runtime upgrade — that is the natural forcing function.

Compatibility notes to watch. Laravel's own global helper set (str(), head(), last(), class_basename(), and others) and Symfony polyfills are the realistic collision candidates. Verify no overlapping names before the first merge, not after.

Operational Impact

Maintenance. Assume ownership. A single-maintainer project with no dependents should be treated as "we are the maintainers, with an upstream we occasionally read." Budget a small recurring allowance for quarterly upstream review, and be prepared to fork. The practical mitigation is scope discipline: depend on three functions, not thirty.

Support. Community-only, via GitLab issues. There is no SLA, no visible security advisory process, and no commercial backing. Our on-call engineers must be able to debug these functions themselves — which is only realistic if the adopted set is small, wrapped, and covered by our own tests. Do not let it become load-bearing infrastructure.

Scaling. No runtime concern whatsoever: plain function calls, no I/O, no state, no container resolution, no caching layer. Any volume of traffic is fine. The scaling problem here is codebase scaling — every adopted function increases the surface an engineer must recognize, and the long-term cost is consistency drift, not CPU.

Failure modes to design against.

  • Fatal redeclaration. A name collision with a future Laravel helper or another package causes an uncatchable fatal at bootstrap — total outage, no graceful degradation. Detect early with the get_defined_functions() diff, and consider guarding with function_exists() at the wrapper layer.
  • Load-order sensitivity. files autoload is generally robust but can behave unexpectedly under unusual bootstraps — Octane, opcache.preload, custom test bootstrappers.
  • Silent behavioural drift. Edge-case handling (null, empty, multibyte) changes quietly across a patch release and passes every test but the one nobody wrote.
  • Abandonment. A future PHP minor deprecates something inside a function we use, with no upstream fix available. Mitigation: wrapper + fork readiness.
  • Idiom drift. Engineers reach for these helpers over Str:: because they're shorter, and the codebase ends up with two conventions for the same operation and no reviewer able to say which is correct.

Ramp-up. Individual learning cost is effectively zero — the functions are self-describing. The team-level cost is governance, not training: a written convention stating "Illuminate\Support\Str/Arr by default; these functions only for the specific enumerated cases," a static-analysis configuration that tolerates the files autoload, a line in the onboarding guide so the dependency is discoverable, and an ADR explaining why it exists. If we are not prepared to write those four artefacts, we should not take the dependency — the package's technical cost is small, but its unmanaged organizational cost is not.

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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin