Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Blade Extensions Laravel Package

radic/blade-extensions

radic/blade-extensions is a collection of practical custom directives that extend Laravel's Blade templating engine. It adds convenient helpers for variable assignment, loop control, and common view tasks, letting you keep templates cleaner and more expressive without writing extra PHP.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy sizing for view-layer tooling. This package is a ~10-directive surface (@foreach with Twig-style loop metadata, @break, @continue, @set, @array). Each directive is a handful of lines behind Blade::directive(). That makes it a useful reference implementation for a build-vs-buy conversation, where "buy" costs a dependency and "build" costs an afternoon.
  • Standardizing template conventions across a design system. If multiple teams hand-roll $i++, $loop->last equivalents, or array_key_first() in views, this package names the problem and gives a vocabulary to standardize on ("loop metadata is available; don't write manual counters").
  • Feature decisions in template-heavy flows. Alternating row styling, separators between list items, "first item gets a hero treatment" — these appear constantly in invoice/PDF generation, transactional email, report exports, and admin data tables. The package directly enables those without touching controllers.
  • Upgrade and technical-debt planning. Because most of this functionality was later absorbed natively by Blade ($loop in 5.3, @break/@continue, @php superseding @set), the package is a marker of legacy code worth scheduling for removal before/alongside a Laravel upgrade.
  • Roadmap signal on "don't own commodity capability." A 264-star, zero-dependent package whose headline feature became native is a case study for a portfolio rule: don't build roadmap dependencies on capability the framework is likely to absorb.

When to Consider This Package

Consider it when:

  • You are on a pre-5.3 Laravel application, or a fork/legacy branch, where $loop metadata does not exist and retrofitting controllers is out of scope.
  • Your template authors are Twig-trained (Symfony/Drupal background) and the loop.index / loop.first / loop.last mental model reduces onboarding and review friction.
  • You have many existing templates doing manual index arithmetic and want a low-touch, view-only standardization — no controller or service changes.
  • The workload is non-interactive rendering (mail, PDF, CSV, invoices) where loop metadata is used heavily and templates are the primary maintenance surface.
  • You are willing to vendor or pin it and have accepted a maintenance/exit plan.

Look elsewhere — or copy the directive implementations in-house — when:

  • You are on Laravel 5.3+, where $loop is native, and especially 5.5+, where @php, @break, and @continue leave only @set and @array as residual value. The value proposition collapses to convenience.
  • Your frontend is Livewire, Inertia, or Vue/React components — presentation logic belongs in the component, not in Blade directives.
  • Supply-chain and longevity policy applies. 264 stars, zero dependents, and a likely dormant maintenance cadence mean no ecosystem validation and no security-response expectation. For a product with a multi-year horizon, an internal 80-line directive file has a lower total cost of ownership than a dependency.
  • You need IDE/static-analysis support, test coverage guarantees, or upgrade guarantees across future Laravel majors.

How to Pitch It (Stakeholders)

For executives (one paragraph): This is a small, MIT-licensed, zero-cost Blade helper that makes templates slightly nicer to write — loop counters, early exits, inline array literals. It is a developer-ergonomics item, not a platform or architecture decision, and it carries no licensing cost. The strategic read is more interesting than the tool: its headline feature was subsequently absorbed into the Laravel framework itself, and the package has no downstream dependents. That tells us to treat it as an idea source rather than a foundation, and to avoid putting roadmap weight on it. If we adopt it at all, we do so with an exit plan that costs roughly one engineer-day.

For engineering (decision framing): Two viable options.

  1. Adopt and pin. Fastest path if you need @set, @array, or loop metadata on an older Laravel. Budget a removal ticket at the same time — the dependency is thin and the semantics are replicable, so the exit cost is low.
  2. Absorb the pattern. Register four or five directives in AppServiceProvider via Blade::directive(). Zero dependency, full control, testable, upgrade-safe. For anything with a horizon beyond one release cycle, this is the recommended path — it captures all the ergonomic value and none of the maintenance risk.

In both cases, the genuinely useful output is the convention: publish a short internal standard stating that loop metadata is available, manual index counters are discouraged, and template-side mutation should be exceptional and reviewable. The package is a credible citation for that standard even if the code never ships.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels