lsrur/toolbelt
A lightweight toolbelt of reusable helpers and utilities for Laravel and PHP projects. It bundles common tools into one package, helping you skip boilerplate, reduce duplication, and keep application code clean, consistent, and easy to maintain.
Architecture fit. lsrur/toolbelt is a global-helper-function package with a Laravel service provider wrapper — the lowest-ceremony integration pattern in the ecosystem. It will register via autoload.files in composer.json and, if a provider is present, through package discovery. That means it slots into any Laravel application without touching the container, config, or routing. The trade-off is architectural: global functions are outside the service container, cannot be resolved or mocked through DI, and are invisible to static analysis unless a stub or IDE-helper file ships with the package. For a codebase already moving toward typed services, actions, and Illuminate\Support\Str/Arr, this is a step backwards in testability and discoverability.
The critical overlap risk is with Laravel's own surface. Laravel 9+ moved substantial helper functionality into Illuminate\Support\Str and Arr and has been quietly deprecating global helpers; a third-party helper set that predates those changes may duplicate, shadow, or (worse) fatally redeclare functions that now ship in illuminate/support. Redeclaration is a hard PHP fatal, not a warning, so this is a binary go/no-go check rather than a nuance.
Integration feasibility. Installation is a one-line composer require. Effort is measured in minutes; the actual work is due diligence, not integration. Before committing, the source must be read end-to-end — this is a small package, so the audit is bounded and cheap, which is the main thing in its favor.
Technical risk. High, and concentrated in provenance rather than complexity:
laravel/framework or illuminate/support version range, Composer may resolve the package into an incompatible app; with an overly tight range, it may block upgrades.Key questions.
function_exists?php and illuminate/support constraints, and do they admit our target Laravel version?Str/Arr/Collection behavior?Stack fit. Presumes a conventional Laravel app on PHP 8.x with Composer 2 and package discovery enabled. No queue, cache, or database footprint is implied by the description, so fit is essentially "does the function set earn its keep." Verify against our actual Laravel minor version before anything else.
Migration path — and the recommended one. Given zero dependents and a bounded function count, the strongest path is vendoring, not depending. Copy the functions we actually want into app/Support/helpers.php, register them under our own autoload.files, keep the license header, and own them. This converts an abandonment risk into a small, permanently stable internal utility, removes a supply-chain dependency, and lets us rename collisions on our terms. The cost is roughly half a day including tests; the alternative is inheriting an unmaintained upstream for functions we could trivially maintain ourselves.
If we do take the dependency, sequence it as follows:
php -l/boot smoke test, and diff the declared function names against get_defined_functions()['user'] and Laravel's helper list.composer why-not laravel/framework is clean and that the package installs at the version we'd pin.composer.lock.Compatibility. Watch three specific things: function_exists guards (absent guards plus a future Laravel helper of the same name equals a fatal on upgrade), PHP 8.4 deprecations around implicit nullable parameters and dynamic properties, and OPcache opcache.enable_file_override/preloading behavior with files autoloading — preloading a file of global functions is fine, but only if no duplicates exist across the preload set.
Maintenance. Effectively zero upstream maintenance obligation — and that is the problem. Nobody is obligated to fix it. Budget for owning it. The vendoring path makes this explicit and bounded rather than a latent surprise during a framework upgrade.
Support. No SLA, no issue-triage history, single maintainer. Internal support means the engineer who audited the package. That person should write the ADR and the vendored copy's docblock; otherwise the knowledge is a single point of failure.
Scaling. Runtime cost is genuinely negligible — global functions are fast, autoloaded once, and cached by OPcache. The scaling risk is organizational: global helpers proliferate call sites and resist refactoring, and shadowed functions create debugging sessions where a developer reads the wrong implementation. In a codebase with more than a handful of contributors, unnamespaced functions become a discoverability tax.
Failure modes.
env() directly, which returns null under config:cache. If any helper does this, it will work locally and fail in production — the classic failure shape for this package category.Ramp-up. Hours, not days. A mid-level Laravel engineer can read the whole source in an afternoon. The gating activity is the collision audit and the vendor-vs-depend decision, both of which are cheap now and expensive if deferred until a framework upgrade forces them.
Verdict. Low technical risk per line of code, high provenance risk. Given zero dependents and a small surface, vendor the functions that prove useful rather than taking a dependency on an unvalidated package. The package is a useful source, not a useful dependency.
How can I help you explore Laravel packages today?