Illuminate Support

The utility backbone of Laravel — string manipulation, fluent config objects, and service-provider bootstrapping, usable standalone in any PHP 8.3+ project.

Library
Composer
vv13.29.0
584stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity48
Maintenance0
Community84
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
52/100Fair
Architecture68
Code Quality55
Innovation60
Learning Curve25

Illuminate Support is the utility layer that Laravel itself is built on: the Str and Stringable classes for string manipulation, the ServiceProvider base class every Laravel package extends, Fluent and MessageBag for structured data access, and a large set of global helper functions (tap, optional, retry, once, defer, and more) that show up throughout the framework’s own source. It ships as an official subtree split of laravel/framework, published independently to Packagist so it can be required without pulling in the rest of the framework.

Because it has almost no hard dependency on the rest of Laravel — only on sibling illuminate/* packages like collections, contracts, and macroable — it is commonly pulled into standalone PHP tools, CLI scripts, and non-Laravel frameworks that just want Str::slug(), Arr-adjacent helpers, or a battle-tested Fluent/MessageBag implementation without adopting the full framework.

What You Get

  • Str and Stringable — over 100 static/fluent methods for slugging, casing, masking, pluralizing, and pattern matching on strings
  • ServiceProvider — the abstract base class for registering bindings, singletons, and boot logic, usable in any container-based app
  • Fluent and MessageBag — structured, array-accessible data containers for config objects and validation-style error collections
  • Global helper functions — tap(), optional(), retry(), once(), defer(), throw_if()/throw_unless(), and more, autoloaded via Composer’s files directive
  • DateFactory and InteractsWithTime — Carbon-backed date creation and time-comparison helpers
  • Number — locale-aware number, currency, and file-size formatting built on PHP’s intl extension

Common Use Cases

  • Pulling Laravel’s Str helpers into a non-Laravel PHP project for slugs, UUIDs, and string transformations
  • Building a custom PHP framework or CLI tool that wants a proven ServiceProvider/container-binding pattern
  • Using Fluent or MessageBag as lightweight structured-data containers outside of Eloquent or validation contexts
  • Formatting numbers, currencies, and file sizes consistently across a codebase via the Number class
  • Memoizing expensive computations with once() or deferring cleanup work with defer() in plain PHP scripts

Under The Hood

Architecture Illuminate Support is a flat collection of independent, largely stateless utility classes rather than a layered application — Str.php, Number.php, Fluent.php, MessageBag.php, ServiceProvider.php, and roughly two dozen siblings each live at the package root with no shared internal orchestration layer between them. The only structural coupling is through Composer: the package declares hard requires on sibling illuminate/collections, illuminate/contracts, illuminate/conditionable, and illuminate/macroable packages, and several classes (Fluent, Str, ServiceProvider) compose in Conditionable and Macroable traits from those packages to gain when()/unless() chaining and runtime-extensible static methods. ServiceProvider is the one class with real architectural weight — it defines the register/boot lifecycle, deferred-provider resolution, and publishable-asset registration that every Laravel package author extends, so a change to its contract would ripple through the entire Laravel package ecosystem, not just this repository. Because this GitHub repo is a read-only subtree split of laravel/framework (confirmed by the .github/workflows/close-pull-request.yml auto-closer), the actual architectural decisions and tests live upstream in the monorepo, not here.

Tech Stack The package targets PHP 8.3+ exclusively and leans on the ctype, filter, and mbstring extensions for its string helpers. Date handling is delegated entirely to nesbot/carbon (^3.8.4) via the DateFactory and Carbon wrapper classes rather than reimplementing date math. Pluralization uses doctrine/inflector (^2.0), and ASCII transliteration in Str::ascii()/Str::slug() is backed by voku/portable-ascii (^2.0.2). A long list of suggest entries — league/commonmark for Str::markdown(), ramsey/uuid for Str::uuid(), symfony/process for the Composer helper class, symfony/uid for ULIDs, symfony/var-dumper for dd(), and vlucas/phpdotenv for Env::get() — shows the package deliberately keeps these as soft, opt-in dependencies rather than hard requirements, so consumers only pay for the extensions they actually invoke. There is no build step: it autoloads via a PSR-4 mapping plus two Composer ‘files’ entries (functions.php, helpers.php) for its global function definitions.

Code Quality This repository, being a mirrored subtree split rather than the primary development location, contains no test suite, no phpunit configuration, and no CI workflow beyond the PR auto-closer — all testing happens upstream in laravel/framework’s monorepo and is not visible here. What is visible is consistently thorough PHPDoc annotation on nearly every public method (param/return types, template generics on Fluent’s TKey/TValue), StyleCI-enforced formatting (evidenced by the StyleCIBot contributor with 108 commits), and PSR-4-conformant naming throughout. Error handling favors typed exceptions over silent failure — e.g. MathException in Exceptions/, and the Timebox class exists specifically to normalize execution time as a timing-attack mitigation for password checks, which signals security-conscious design even without local tests to verify behavior.

API Design Most of the package covers well-trodden ground — string/array helpers exist in Symfony String, Laravel’s own long history, and countless other PHP utility libraries — but a few primitives stand out as genuinely useful, less-common patterns: once() memoizes a callable’s result per call-site using debug_backtrace() to generate a cache key, so repeated calls to the same expression in a loop or view only execute once; defer() (paired with the Defer/DeferredCallback classes) schedules a callback to run after the HTTP response has been sent, giving PHP a lightweight analog to after-response hooks without needing a queue; and Lottery provides a declarative, testable API for probabilistic code execution (e.g. sampling 1% of requests for extra logging) rather than the usual inline mt_rand() % 100 pattern scattered through codebases.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search