PHPackages                             bardh78/laravel-wisra - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. bardh78/laravel-wisra

ActiveLibrary[Templating &amp; Views](/categories/templating)

bardh78/laravel-wisra
=====================

Inject HTML comments into compiled Blade templates showing view file paths. Useful for debugging and IDE integration (e.g. Wisra).

v0.1.2(2mo ago)08↓75%MITPHPPHP ^8.2

Since Mar 19Pushed 1mo agoCompare

[ Source](https://github.com/bardh78/laravel-wisra)[ Packagist](https://packagist.org/packages/bardh78/laravel-wisra)[ Docs](https://github.com/bardh78/laravel-wisra)[ RSS](/packages/bardh78-laravel-wisra/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Laravel Wisra
=============

[](#laravel-wisra)

Inject HTML comments and attributes into compiled Blade templates to expose view file paths and source line numbers. Useful for debugging, IDE integration (e.g. [Wisra](https://github.com/laravel/wisra)), and **AI/LLM-assisted development**.

Installation
------------

[](#installation)

Install via Composer as a development-only dependency:

```
composer require --dev bardh78/laravel-wisra
```

The package auto-discovers its service provider. Laravel Wisra is always local-only and should not be installed as a production/runtime dependency.

### Configuration (optional)

[](#configuration-optional)

Publish the config file to customize behavior:

```
php artisan vendor:publish --tag=config
```

Or publish only this package's config:

```
php artisan vendor:publish --provider="Bardh78\LaravelWisra\LaravelWisraServiceProvider"
```

Environment variables:

VariableDefaultDescription`LARAVEL_WISRA_ENABLED``true`Enable or disable the instrumentation`LARAVEL_WISRA_SKIP_LIVEWIRE``true`Skip instrumentation for Livewire views and update requests`LARAVEL_WISRA_INJECT_CONTEXT_META_TAGS``true`Inject request-level Wisra meta tags into the document ``> **Note:** After enabling or disabling Wisra, clear the compiled view cache so changes take effect:
>
> ```
> php artisan view:clear
> ```

What it does
------------

[](#what-it-does)

- **View path comments** — Wraps each compiled view with `` and ``
- **Line annotations** — Adds `wisra-start-line` and `wisra-end-line` attributes to HTML elements for source mapping
- **Translation comments** — Wraps `__()` and `trans()` echoes with `` for easier translation debugging

How LLMs benefit from it
------------------------

[](#how-llms-benefit-from-it)

When AI coding assistants (Cursor, Copilot, Claude, etc.) work with your Laravel app, they often need to:

1. **Inspect rendered output** — Via browser tools, DOM snapshots, or page source
2. **Map HTML back to source** — Find which Blade file and line produced a given element
3. **Suggest precise edits** — Know exactly where to change code

**Without Laravel Wisra:** The assistant sees raw HTML with no trace to the Blade source. It must guess files, search the codebase, or rely on structure alone.

**With Laravel Wisra:** The rendered HTML includes:

- **Exact file paths** in comments, so the assistant knows which view file to edit
- **Line numbers** on elements via `wisra-start-line` and `wisra-end-line`, so it can target the correct line
- **Translation file paths** for `__()` calls, so it can update the right lang file

### Example

[](#example)

Rendered HTML with Wisra:

```

  Welcome to our app

```

An LLM can now:

- Open `resources/views/welcome.blade.php` and edit around lines 5–12
- Open `lang/en/welcome.php` to change the translation for the heading
- Avoid searching or guessing which files to modify

### Best practices for LLM workflows

[](#best-practices-for-llm-workflows)

1. **Install in development only** — Use `composer require --dev`; the package also refuses to instrument non-local Laravel environments
2. **Use with browser MCP tools** — When the assistant inspects the page, it gets file/line hints
3. **Combine with Cursor rules** — Mention that view comments are present so the assistant knows to use them

Livewire compatibility
----------------------

[](#livewire-compatibility)

Laravel Wisra skips instrumentation for Livewire by default:

- **Livewire update requests** are ignored so Wisra doesn't alter Livewire's AJAX payload rendering
- **Views in `resources/views/livewire/...`** are ignored
- **Templates containing Livewire syntax** like `@livewire`, ``, `wire:*`, or `$wire` are ignored

If you intentionally want Wisra annotations inside Livewire-rendered Blade, set `LARAVEL_WISRA_SKIP_LIVEWIRE=false`.

Request context meta tags
-------------------------

[](#request-context-meta-tags)

When a Blade document contains a `` tag, Wisra can inject request-level meta tags like:

```

```

These values are rendered at runtime, so they stay correct even when Blade views are cached.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10.x, 11.x, or 12.x

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

2

Last Release

89d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd68a6428ae826863d35b469e3080cc59b8831dcc5c478a067120abcfa691c10?d=identicon)[bardh78](/maintainers/bardh78)

---

Top Contributors

[![bardh78](https://avatars.githubusercontent.com/u/85450418?v=4)](https://github.com/bardh78 "bardh78 (9 commits)")

---

Tags

laraveldebugbladeviewbardh78wisra

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bardh78-laravel-wisra/health.svg)

```
[![Health](https://phpackages.com/badges/bardh78-laravel-wisra/health.svg)](https://phpackages.com/packages/bardh78-laravel-wisra)
```

###  Alternatives

[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.3k449.3k30](/packages/tightenco-jigsaw)[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k531.0k21](/packages/robsontenorio-mary)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[spatie/laravel-blade-comments

Add debug comments to your rendered output

179332.0k](/packages/spatie-laravel-blade-comments)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5452.7k](/packages/hasinhayder-tyro-dashboard)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18379.7k9](/packages/technikermathe-blade-lucide-icons)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
