hieu-le/active
Laravel helper for detecting the active state of routes URLs and requests, making it easy to highlight the current menu item, tab, or link in your navigation. Provides simple isActive methods and Blade-friendly checks with flexible pattern matching.
Architecture fit. hieu-le/active is a presentation-layer convenience, nothing more: a service provider, a facade (Active), and global helper functions that compare the current route against a name/URI/controller/action pattern and return a CSS class (active) or a default. It touches no persistence, no queue, no auth, no domain logic. Its only architectural role is keeping Bootstrap-style nav markup tidy in Blade templates — a job Laravel now does natively via request()->routeIs(), Route::is(), and the @class directive. Architectural weight is near-zero benefit against non-zero dependency surface.
Integration feasibility. High in the mechanical sense: composer require hieu-le/active, package auto-discovery, optional facade alias, done. No config, no migrations, no published assets. The public surface is small — Active::getActiveClass(), isActive(), controller/action/URI variants, and an active_class() helper — so both adoption and removal are one-liners. This is the easiest possible thing to integrate and the easiest possible thing to replace.
Technical risk.
illuminate/support constraint: if it pins to 5.x–8.x/9.x, it becomes a hard blocker on a Laravel 10/11 upgrade and forces either a fork, --ignore-platform-reqs, or an unplanned migration.files autoload are defined at autoload time, so a redeclaration with an app helper or another package is a fatal error at boot, not a lazy failure at a call site.Key questions.
illuminate/* constraint admit them?active_class()? If the latter, a 15-line directive or <x-nav-link> component reproduces it exactly.active_class() or an Active alias?Stack fit. Fits only legacy server-rendered Blade applications on Laravel 5.x–9.x with Bootstrap-style navs. Poor fit for Inertia/Livewire front ends where active state belongs in the client router, and pure dead weight in API-only services.
Migration path. Two steps, both mechanical. (1) Introduce an app-owned shim — App\Support\ActiveNav or an @active('route.*') Blade directive — implemented over request()->routeIs(), keeping call sites unchanged. (2) Repoint the facade/helper at the shim, remove the package from composer.json, delete the provider and alias. Because the surface is essentially active_class(...) plus a few Active:: methods, this is a codemod, not a redesign; no template rewrites are required if the shim preserves signatures.
Compatibility. Inspect composer.json for illuminate/support and php constraints before anything else — that single file determines whether this is a five-minute swap or an upgrade blocker. Then check for str_is/Str::is usage, facade alias registration, and files autoload of helpers. Validate against your route-cache output, since pattern matching against route names behaves differently once routes are cached.
Sequencing. Do not add to greenfield. For existing usage, time removal to the next Laravel major upgrade window so the package is never the reason an upgrade stalls. Freeze new call sites now and treat any addition as tech debt with a name attached. If a blocker lands before the upgrade window, fork into an internal namespace, pin it, and put it on a deprecation clock with an owner and a removal date.
Maintenance. Zero upstream. MIT licensing makes forking cheap and legal, but every fork becomes our code. Run cost is near-zero; stewardship cost is version constraints, audit findings, and upgrade reviews. Operate it as a vendored snippet with an owner, not as a dependency with an expectation of support.
Support. No issue triage, no advisories, no maintainer response. Internal support is whoever last touched a call site. Document the shim and the replacement path in-repo rather than linking upstream docs that will rot.
Scaling. Functionally irrelevant — a few string comparisons per render, O(nav items × patterns), trivially cacheable if navs ever get large. The scaling risk is organizational: one archived package can surface in a dependency-policy review and block a platform-wide upgrade.
Failure modes. Fatal helper redeclaration at boot; facade alias failing to resolve post-upgrade; route renames silently dropping active state (cosmetic, silent, test-invisible unless you assert markup); Composer constraint conflicts during framework upgrades; stale docs leading new engineers to add call sites after a removal decision has been made.
Ramp-up. Minutes. The API is a handful of methods and one helper; the native replacement is routeIs(). The real onboarding work is social: making clear the package is archived and that the shim — not the package — is the sanctioned pattern.
Bottom line. Archived, zero dependents, minimal code value, and functionally superseded by framework features. Do not adopt. If already present, replace with an internal helper or Blade directive wrapping request()->routeIs() and retire the dependency at the next upgrade window. The high opportunity score reads as "room for a trivial native replacement," not "undervalued asset."
How can I help you explore Laravel packages today?