Weave Code
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

Blaze Laravel Package

livewire/blaze

Blaze accelerates Laravel anonymous Blade components by compiling templates into optimized PHP functions, cutting 91–97% of rendering overhead with drop-in compatibility. Enable per component via @blaze or optimize directories, with optional memoization and folding.

View on GitHub
Deep Wiki
Context7

Pre-compile Blade components for blazing fast rendering performance

Frequently asked questions about Blaze
How do I install Livewire Blaze in my Laravel project?
Run `composer require livewire/blaze:^1.0` to install Blaze. No additional setup is needed for basic usage, though Flux UI users get automatic compatibility. Clear compiled views afterward with `php artisan view:clear`.
Can Blaze replace all my Blade components, or only anonymous ones?
Blaze is designed as a drop-in replacement for **anonymous Blade components** (e.g., `@component('button')`). It won’t work with named components or custom classes. Test thoroughly, especially for dynamic or nested includes.
What Laravel versions does Blaze support?
Blaze is compatible with Laravel 10.x and 11.x. Check the [GitHub repo](https://github.com/livewire/blaze) for the latest version requirements. It relies on Laravel’s Blade engine, so ensure your project meets Blade’s minimum PHP 8.1+ requirement.
How do I enable Blaze for specific components vs. entire directories?
Use `@blaze` at the top of individual anonymous components for granular control. For bulk optimization, call `Blaze::optimize()->in(resource_path('views/components'))` in your `AppServiceProvider::boot()`. Start with directories to minimize risk.
Will Blaze break Livewire components or reactive properties?
Blaze works seamlessly with Livewire’s anonymous components (e.g., `{{ $widget }}`), but custom Livewire components with public properties may need testing. Reactive features like `@entangle` or `@on` should remain unaffected if used within supported Blade directives.
What are the risks of using memoization or folding strategies?
Memoization caches repeated renders, which is ideal for static or infrequently updated content but risks stale data if not invalidated properly. Folding pre-renders to HTML, improving speed but eliminating dynamic logic. Test these in staging first, especially for user-specific content.
How do I monitor Blaze’s performance impact?
Use Laravel Debugbar to compare rendering times before/after enabling Blaze. Log component-specific metrics with `Blaze::track()` or instrument your `AppServiceProvider` to measure optimization effectiveness per directory.
Does Blaze work with third-party Blade directives or custom packages?
Blaze supports core Blade directives (`@if`, `@foreach`, `@stack`) but may not recognize custom directives or packages that modify Blade’s rendering pipeline. Test thoroughly, especially if you rely on dynamic `@include` or complex inheritance.
Can I use Blaze in production without additional configuration?
Yes, but enable it incrementally. Start with non-critical components (e.g., footers) and monitor for regressions. For memoization/folding, implement cache versioning (e.g., checksum-based paths) to avoid stale content during deployments.
What alternatives exist for optimizing Blade rendering in Laravel?
Alternatives include caching entire views with `view()->share()` or using Laravel’s built-in `@once` directive for static content. For dynamic UIs, consider Livewire’s built-in reactivity or frontend frameworks like Alpine.js. Blaze uniquely targets anonymous components with near-zero refactoring.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport