- How do I install wearedevtical/laravel-helpers in a Laravel app?
- Install it with Composer using composer require wearedevtical/laravel-helpers. Laravel package auto-discovery registers the service provider, and you can publish the configuration using the helpers-config tag. Then add helper files and use the artisan commands to list or generate helpers.
- Does laravel-helpers support Laravel 10 and PHP 8.1 or 8.2?
- No, v3.0.0 requires PHP 8.3 or newer, so a Laravel 10 app on PHP 8.1 or 8.2 cannot use it. Those teams should stay pinned to v2.1.0 until they upgrade PHP. Check your actual runtime matrix before planning an upgrade.
- What artisan commands are included in laravel-helpers?
- The package provides helper:list, make:helper, helper:validate, and helper:reload. helper:list shows discovered helpers and supports --json, make:helper scaffolds a new helper file, helper:validate checks syntax and duplicate functions, and helper:reload refreshes helper loading. These commands are developer tooling, not request-lifecycle features.
- How does laravel-helpers autoload global helper functions?
- A HelperManager discovers and requires plain PHP helper files at boot. That makes functions globally available without class imports, which is convenient but means loading failures can surface later as undefined function errors. It is an optional convenience layer rather than a load-bearing architectural component.
- What does helper:validate check in laravel-helpers?
- helper:validate performs syntax checking and duplicate-function detection across helper files. Duplicate function declarations are the classic fatal-error failure mode for this global-function pattern, so this is a valuable CI check. You should confirm whether its duplicate detection covers every cross-file redeclaration case before treating it as a full replacement for manual review.
- What do the strict and log_errors config options do in laravel-helpers?
- v3.0.0 adds strict and log_errors config flags, but the release notes do not state their defaults or exact runtime semantics. If strict defaults to on and turns a previously silent failed load into an exception, an upgrade could turn a degraded app into a boot failure. Read the published config stub and test the flags before rollout.
- What happens if a helper file fails to load in Laravel?
- The failure semantics are ambiguous: the package may log the failure and continue with a partial helper set, which means missing global functions only appear at call time as Call to undefined function. That is a runtime failure, not a boot failure. Logging improves diagnosability but does not make a partial load safe, so verify strict behavior in staging.
- Can I use helper:list --json output in a CI pipeline?
- Yes, helper:list --json turns the command into machine-readable output that a pipeline can assert on. The key question is whether that JSON schema is documented as stable; if it is not, pin the package version and validate the shape in tests. It is useful for detecting unexpected helper discovery changes.
- What changed in laravel-helpers v3.0.0 and how do I upgrade?
- v3.0.0 is a focused major, not a rewrite, but it raises the PHP floor to 8.3 and moves to spatie/laravel-package-tools. The config publish tag is renamed to helpers-config, and new strict and log_errors flags plus helper:validate and helper:reload are added. Update deployment scripts, review the new dependency, and check the config defaults before upgrading; otherwise stay on v2.1.0.
- Is wearedevtical/laravel-helpers production-ready and what are the alternatives?
- It is low-risk to add because it does not touch the request lifecycle, persistence, auth, or queues, and it is easy to remove. Production concerns are the PHP 8.3 floor, the undeclared strict and log_errors defaults, ambiguous partial-load behavior, and the added spatie/laravel-package-tools dependency. Alternatives include Composer files autoloading, a small custom helper service provider, or class-based utility packages if you want stricter structure.