roots/support
General-purpose helper functions used across Roots WordPress projects. Includes Laravel-style env() lookup, value() for closures, utilities to add/remove callbacks across multiple WordPress actions/filters, and a wp_die() wrapper with Roots defaults.
Roots\env() fallback to Illuminate\Support\Env::get()). Ideal for hybrid WordPress/Laravel projects requiring seamless integration of helpers like array_get(), str_plural(), or esc_html().Roots\Closure namespacing and Laravel Env compatibility reduces friction for teams adopting Laravel’s ecosystem incrementally.Roots\env() as a drop-in replacement for Laravel’s Env in non-Laravel contexts, with fallback support.get_template_part()) while sharing utility logic with Laravel’s Illuminate\Support.array_get() → Arr::get()).Roots\env() with Laravel Env fallback).apply_filters() or esc_html().Roots\Closure namespacing quirks).Str::of(), Arr::pluck())—use Illuminate\Support directly.Symfony\Component\String).array_get() behavior) and prefer in-house control.For Executives:
"This updated Roots/Support package (v1.0.1) bridges WordPress and Laravel ecosystems with lightweight, MIT-licensed helpers—cutting development time by 20–40% on utility tasks like data sanitization or template resolution. The latest release adds Laravel Env compatibility and fixes namespacing issues, making it ideal for our [hybrid WordPress/Laravel] project. It’s a low-risk ‘buy’ to eliminate technical debt while keeping costs minimal, with active community contributions signaling ongoing support."
For Engineering:
*"Roots’ support package (v1.0.1) now offers:
Roots\env() falls back to Illuminate\Support\Env::get(), enabling shared utility logic across WordPress/Laravel codebases.Roots\Closure namespacing issues and improves stability for production use.esc_html()) in Laravel contexts without full framework overhead.
Tradeoffs:Illuminate\Support).Roots\Closure may require adjustments if integrating with Laravel’s Closure handling.
Suggest evaluating if our use case aligns with its [WordPress/Laravel hybrid helpers]—e.g., array_get(), str_plural(), or env() fallback."*How can I help you explore Laravel packages today?