torchlight/torchlight-laravel
Torchlight syntax highlighting for Laravel. Highlight code blocks with VS Code-compatible themes and zero JavaScript. Includes caching, configurable themes and host, and Blade components/directives. Requires a Torchlight API token (free for personal/open source).
torchlight:install). No complex migrations or database changes.@torchlight) simplifies adoption in existing templates..env, supporting staging/production parity.TORCHLIGHT_HOST override).composer require torchlight/torchlight-laravel).php artisan torchlight:install) and set TORCHLIGHT_TOKEN.@torchlight in a Blade view.cache:array for dev, cache:redis for prod).<details> for collapsible blocks).@highlight (Prism.js) with @torchlight or @torchlightBlock.Torchlight::highlight() in controllers for dynamic code generation.| Phase | Task | Dependencies |
|---|---|---|
| Prep | Generate Torchlight API token | Torchlight.dev account |
| Install | Composer install + config publish | Laravel 9+ |
| Test | Replace 1–2 code blocks in Blade views | Existing Blade templates |
| Optimize | Configure cache driver and TTL | Performance benchmarks |
| Expand | Add post-processors/macros for custom logic | Business logic requirements |
| Monitor | Set up alerts for API failures | Sentry/New Relic |
.env or config/torchlight.php updates.TORCHLIGHT_DEBUG=true for verbose output.<div class='line'> wrappers if API fails (configurable).cache:forever for static content).| Scenario | Impact | Mitigation |
|---|---|---|
| Torchlight API downtime | Broken code blocks | Fallback to static <pre> tags |
| Cache corruption | Stale code rendering | Clear cache (php artisan cache:clear) |
| Rate limit exceeded | 429 errors | Upgrade Torchlight plan or reduce TTL |
| Theme misconfiguration | Broken styling | Validate TORCHLIGHT_THEME in tests |
@torchlight usage.How can I help you explore Laravel packages today?