blaze-optimize

Installs and configures Blaze to compile anonymous Blade components into optimized PHP functions.

1|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/karuhun-developer/ecommerce --skill blaze-optimize-karuhun-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: blaze-optimize
Source: https://github.com/karuhun-developer/ecommerce/tree/main/.cursor/skills/blaze-optimize
Command: npx skills add https://github.com/karuhun-developer/ecommerce --skill blaze-optimize-karuhun-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires livewire/blaze, and includes references (resource) components.

What problem does it solve? Rendering large numbers of Blade components in Laravel applications adds runtime overhead. This Skill automates the setup of Livewire Blaze so anonymous Blade components are compiled into optimized PHP functions, reducing rendering cost without manual configuration. ## Core Features & Use Cases - Automated Installation & Setup: Installs livewire/blaze via Composer, scans the codebase for components and custom component paths, and registers Blaze::optimize() in AppServiceProvider. - Compatibility Checking: Greps components for unsupported patterns (class-based components, $component variable, view composers, View::share) and excludes incompatible files from compilation. - Advanced Optimization: Applies trace-based or code-analysis-driven memoization and folding strategies, with a full folding-safety checklist covering global state, props, slots, and attribute bags. - Use Case: A Laravel app with hundreds of anonymous components in resources/views/components renders slowly on catalog pages. Run this Skill to enable Blaze compilation, browse the slow pages to collect trace data, then apply memo and fold optimizations to the slowest components. ## Quick Start Set up Blaze in my Laravel project and optimize my Blade components for faster rendering.

Frequently Asked Questions about blaze-optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Blade component rendering in Laravel?▼

Install livewire/blaze via Composer and register Blaze::optimize()->in(resource_path('views/components')) in AppServiceProvider::boot(). Blaze compiles anonymous Blade components into optimized PHP functions, reducing rendering overhead.

How do I install Livewire Blaze in a Laravel project?▼

Run composer require livewire/blaze:^1.0, then add Blaze::optimize()->in(resource_path('views/components')) to the boot method of AppServiceProvider. Set BLAZE_DEBUG=true in .env and run php artisan view:clear to finish setup.

Does Blaze work with Livewire Flux components?▼

Yes, Blaze optimizes Flux components automatically once the package is installed, with no additional configuration needed. If the project also has its own anonymous components, those directories can be registered separately with Blaze::optimize().

Which Blade components are not compatible with Blaze?▼

Blaze only supports anonymous components, so class-based components in app/View/Components are excluded. Components using the $component variable, view composers or creators, View::share variables, or rendered via view() instead of component tags are also incompatible.

When should I not use folding on a Blade component?▼

Do not fold components that access global state such as auth, session, request, errors, time, CSRF, database queries, config, or cache, since folding bakes output at compile time and produces stale HTML. Also avoid folding when props drive internal logic or when the component is frequently modified during development.

Why does a Blaze-optimized component render stale or broken output?▼

Stale output usually means a folded component accesses global state or a memoized component has slots. Remove the @blaze directive or mark the directory with compile: false, then run php artisan view:clear and retest the page.