PHPackages                             malikad778/laravel-blade-ally - 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. malikad778/laravel-blade-ally

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

malikad778/laravel-blade-ally
=============================

Static Accessibility Analyzer for Laravel Blade &amp; Livewire Templates

V1.0.0(1mo ago)00MITPHPPHP ^8.2

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/malikad778/blade-access)[ Packagist](https://packagist.org/packages/malikad778/laravel-blade-ally)[ RSS](/packages/malikad778-laravel-blade-ally/feed)WikiDiscussions main Synced 1w ago

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

Laravel Blade Ally 🛡️
=====================

[](#laravel-blade-ally-️)

> **Static Accessibility Analyzer for Laravel Blade &amp; Livewire Templates**
> Catch WCAG 2.2 AA violations in your PHP source code before a single request is served.

[![Latest Version on Packagist](https://camo.githubusercontent.com/0108ba0b82666a1337ce611c8b642da56989b22f98a1869ffd485c6ce4537642/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616c696b61643737382f6c61726176656c2d626c6164652d616c6c792e737667)](https://packagist.org/packages/malikad778/laravel-blade-ally)[![Tests](https://github.com/malikad778/blade-access/actions/workflows/tests.yml/badge.svg)](https://github.com/malikad778/blade-access/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/187240af044d09d5b14a1d9d9ebdf3f7a993e4c7bc09bdb46b4ba661a891bf5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c7565)](https://php.net)[![Laravel Version](https://camo.githubusercontent.com/37917a13ceb45a44dd8d8ed22f6dc88a0a9cf594ce42190234e616043d3a53b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253243253230313125324325323031322d726564)](https://laravel.com)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![EAA Compliant](https://camo.githubusercontent.com/cf1b745d7356c94a91c5cb278a2d55c3914b550806709c29e35785b60d317f04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4541412d3230323525323052656164792d626c756576696f6c6574)](https://ec.europa.eu/accessibility)

---

Why laravel-blade-ally Exists
-----------------------------

[](#why-laravel-blade-ally-exists)

The **European Accessibility Act (EAA)** came into force in June 2025. WCAG AA compliance is now a legal requirement for public-facing web applications across the EU.

Existing tools like **axe-core**, **Lighthouse**, and **WAVE** run in the browser at runtime—after your code has been deployed. They catch nothing in CI. They cannot easily analyze dynamic Blade conditionals, Livewire component trees, or slot-rendered layouts, and they require a running server.

**laravel-blade-ally** is the missing layer: a static analysis engine that parses your Blade templates and Livewire components as source code, detects WCAG violations before compilation, and integrates into your CI/CD pipeline—acting just like PHPStan but for your frontend accessibility.

🚀 Installation
--------------

[](#-installation)

You can install the package via composer (typically as a development dependency):

```
composer require malikad778/laravel-blade-ally --dev
```

You can publish the configuration file using:

```
php artisan ally:init
```

This will publish the `blade-ally.php` config file to your `config/` directory.

🛠️ Usage
--------

[](#️-usage)

Run the static analyzer across your entire `resources/views` and `app/Livewire` directories:

```
php artisan ally:analyze
```

### Options

[](#options)

- **Specify paths:** `php artisan ally:analyze resources/views/components app/Livewire`
- **Change output format:** `php artisan ally:analyze --format=json` (Available formats: `terminal`, `json`, `html`, `checkstyle`, `github`, `sarif`, `junit`)
- **Filter by severity:** `php artisan ally:analyze --severity=error`

### Understand a Rule

[](#understand-a-rule)

If you want to know why a specific rule failed or how to fix it:

```
php artisan ally:explain img-missing-alt
```

### Working with Baselines

[](#working-with-baselines)

Just like PHPStan, you can create a baseline to ignore existing legacy violations and only enforce rules on new code:

```
php artisan ally:baseline
```

Subsequent runs of `ally:analyze` will automatically ignore the violations recorded in the baseline file.

✨ Feature Overview
------------------

[](#-feature-overview)

### Core Engine

[](#core-engine)

- **Full Blade Parser:** Understands `@if`, `@foreach`, `@include`, `@extends`, `@yield`, ``, and `` layouts.
- **Smart Livewire Analyzer:** Understands `wire:click`, `wire:loading`, `wire:navigate`, and correlates Livewire PHP class logic with the component's Blade view.
- **Alpine.js Aware:** Respects `x-on:click`, `x-show`, and dynamically bound Alpine attributes.
- **CI/CD Ready:** Returns hard exit codes on failures. Native support for GitHub Annotations and SARIF (for GitHub Code Scanning security tabs).

### Complete WCAG Coverage (73 Rules Across 13 Categories)

[](#complete-wcag-coverage-73-rules-across-13-categories)

The engine currently validates exactly 73 distinct criteria, including:

- **Images &amp; Media (SC 1.1.1, 1.2.x):** Enforces meaningful `alt` text, prevents redundant filenames in alts, enforces `` titles, catches `div` backgrounds used as generic images, and checks for `` captions.
- **Forms (SC 1.3.1, 3.3.2):** Validates implicit and explicit `` connections. Ensures required fields have correct `aria-required` tags, and input validation is properly linked via `aria-describedby` or `role="alert"`.
- **Buttons &amp; Links (SC 2.4.4, 4.1.2):** Catches empty links, generic "click here" text, Javascript `href` voids, and `` missing keyboard tabindexes.
- **Tables &amp; Structure (SC 1.3.1):** Enforces correct `` scopes, catches skipped heading levels (e.g., `h2` to `h4`), missing `` landmarks, and duplicate `` tags.
- **Modals &amp; Dialogs (SC 4.1.2):** Enforces `role="dialog"`, trapped focus management, and `@keydown.escape` handlers.
- **ARIA Verification (SC 4.1.2):** Prevents impossible ARIA roles, validates parent/child ARIA associations (e.g. `role="rowheader"` must be inside a row container), and prevents `aria-hidden` on focusable elements.
- **Livewire Specific:**
    - `livewire-poll-no-pause`: Enforces `wire:poll.visible` for performance and screen-reader sanity.
    - `wire-loading-aria-live`: Ensures visual `wire:loading` states are announced to screen readers.
    - `livewire-dispatch-focus`: Tracks missing focus management when Livewire dispatches DOM-altering events.

⚙️ Configuration
----------------

[](#️-configuration)

Your `config/blade-ally.php` allows fine-grained control over the analysis:

```
return [
    'paths' => [
        resource_path('views'),
        app_path('Livewire'),
    ],

    // Ignore specific files or directories
    'exclude_paths' => [
        resource_path('views/vendor'),
    ],

    // Toggle individual rules
    'rules' => [
        'img-alt-filename' => false, // Disable specific rule
        'heading-multiple-h1' => true,
    ],
];
```

🔄 Continuous Integration
------------------------

[](#-continuous-integration)

**laravel-blade-ally** is designed for automated checks.

### GitHub Actions Example

[](#github-actions-example)

```
name: Accessibility Analysis
on: [push, pull_request]

jobs:
  blade-ally:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'
      - run: composer install --prefer-dist --no-progress
      - name: Run Blade Ally
        run: php artisan ally:analyze --format=github
```

*Using `--format=github` will place inline annotations directly on your Pull Request files!*

🧪 Testing
---------

[](#-testing)

We use Pest/PHPUnit to ensure parser integrity and rule accuracy:

```
composer test
```

*(Tests cover HTML implicit semantics, Blade tokenization, Livewire bindings, and AST traversal).*

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance89

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

58d ago

### Community

Maintainers

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

---

Top Contributors

[![malikad778](https://avatars.githubusercontent.com/u/86764206?v=4)](https://github.com/malikad778 "malikad778 (2 commits)")

---

Tags

a11yaccessibilityaccessibility-checkerariabladecieaalaravellaravel-packagelinterlivewirestatic-analysiswcagwcag-compliancewcag2laravelstatic analysisbladelivewireaccessibilitywcag

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/malikad778-laravel-blade-ally/health.svg)

```
[![Health](https://phpackages.com/badges/malikad778-laravel-blade-ally/health.svg)](https://phpackages.com/packages/malikad778-laravel-blade-ally)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k449.3k30](/packages/tightenco-jigsaw)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

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

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

719160.4k12](/packages/tallstackui-tallstackui)

PHPackages © 2026

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