Download the PHP package webcrafts-studio/lens-for-laravel without Composer

On this page you can find all versions of the php package webcrafts-studio/lens-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lens-for-laravel

Lens for Laravel

A local-first accessibility auditor for Laravel applications.

Lens for Laravel scans your application with axe-core, renders JavaScript through Spatie Browsershot, maps violations back to source files, and can generate AI-assisted fixes for Blade, React, and Vue code.

v3.5 development line: adds an optional explicit AI model override and dashboard info about the active AI Fix model. The v3.4 authenticated scans, additional providers, v3.3 Ollama support, and earlier v3 foundations remain unchanged.

v3.4: adds authenticated scans for pages behind login plus four additional AI Fix providers (OpenRouter, xAI, DeepSeek, Mistral).

v3.3: adds local AI Fix models through Ollama.

Documentation & full feature overview -> lens.webcrafts.pl


Features


Requirements

Requirement Version
PHP ^8.2
Laravel ^10.0 | ^11.0 | ^12.0 | ^13.0
Node.js Any recent LTS
Puppeteer ^21 recommended
Chromium Provided by Puppeteer or your environment

Lens uses Browsershot to control Chromium. Install Puppeteer in the host application:

If your environment requires a custom Chromium, Node, or npm path, configure Browsershot through your application environment as you normally would.

AI Fix has a narrower runtime matrix than the core scanner:

AI Fix requirement Version
PHP ^8.3
Laravel ^12.0 | ^13.0
Optional SDK laravel/ai 0.3.2 or newer

Laravel 10/11 and PHP 8.2 applications retain scanning, crawling, history, PDF, preview, source location, interactive states, and CLI support. The dashboard hides AI Fix actions and explains why they are unavailable.


Installation

Install Lens as a development dependency:

The service provider is auto-discovered.

The core package intentionally does not require an AI SDK. On a supported runtime, install AI Fix separately when you want generated fixes:

AI Fix is optional. Lens continues to work without this package.

Run migrations if you want scan history:

Publish the config when you want to customize behavior:

Optionally publish package views:


Quick Start

Start your Laravel app and open:

Enter a URL from the same host as APP_URL, then run a scan. Results include:

Choose WCAG 2.0, 2.1, or 2.2 before starting the scan. Later versions include the rules from earlier versions plus axe-core rules for the newer success criteria. Existing installations continue to default to WCAG 2.0.


Supported Frontends

Blade

Blade support is the most direct path. Lens scans the rendered DOM and searches resources/views/**/*.blade.php for matching elements, IDs, names, classes, attributes, and selectors.

Since v3.2, the Blade locator also:

AI Fix can modify located .blade.php files under resources/views.

Livewire

Livewire works through the rendered DOM and the same structural Blade source locator, including named route helpers, nested markup, and nearby selector context. For delayed hydration or UI updates, use:

Automated scans only inspect the current browser state after page load. Interactive states such as open modals, validation errors, dropdowns, and tabs still need targeted URLs or manual review.

React

Lens locates React source files under:

It supports common JSX/TSX patterns such as:

AI Fix can modify supported React files under resources/js.

Vue

Lens locates Vue single-file components under:

It supports common Vue template patterns such as:

AI Fix can modify .vue files under resources/js.

Inertia

Inertia React and Vue apps are supported through the React/Vue source locators. For route discovery in SPA-heavy apps, enable JavaScript crawling:


Dashboard

The dashboard has two primary tabs.

Scanner

Run scans in four modes:

Each issue can be expanded to inspect the failing node, copy the selector, preview the element, open the source file in your editor, or request an AI fix.

Interactive state scans can be recorded visually in the dashboard. Click Record to open a recorder window, interact with the target page, create named states as you move through the flow, and send the generated script back to Lens. You can also paste or edit the raw script directly. The generated format stays copyable and CI-friendly:

Supported actions are click, type, select, check, uncheck, and wait.

Save the same script in a file to run it from the CLI:

Interactive-state CLI scans support WCAG selection, level filters, thresholds, and baselines. They require one URL and cannot be combined with --crawl.

History

History stores scan runs and issue metadata in your database. It supports:


Artisan Command

Run audits from the terminal:

The CLI uses the same scanner, crawler, interaction-script parser, source locator, and source type metadata as the dashboard. State labels are printed in the diagnostic table and preserved in baselines.

--wcag=2.0, --wcag=2.1, and --wcag=2.2 select the standard version. This is independent from --a, --aa, and --all, which select the conformance levels shown in the result. The default standard is WCAG 2.0. When changing the standard used by a baseline workflow, create a fresh reviewed baseline.

Baseline Quality Gate

Use the baseline gate when an existing application already has accessibility issues and you want CI to block only new regressions.

By default, Lens stores the baseline in:

The comparison uses stable fingerprints based on the rule, normalized URL path, selector, and source file when available, so a different local or CI host does not invalidate the baseline.

Local HTTPS Certificates

For local environments with self-signed certificates, such as DDEV or Laravel Valet, enable:

The default is false, so production-like scans stay strict unless you explicitly opt in.


Configuration

Published config file:

Environment Options

Set LENS_FOR_LARAVEL_IGNORE_HTTPS_ERRORS=true only for trusted local environments with self-signed certificates. Since v3.0 the setting consistently covers axe scans, sitemap and page requests made by the crawler, optional JavaScript-rendered crawling, and element preview screenshots. Its default remains false.

Authenticated scans

Pages behind login can be scanned by impersonating an existing user of the host application:

The dashboard shows a user ID field when the feature is enabled; crawling, state scans, and element previews accept the same user. Only the numeric id travels from the client - Lens logs in server-side through the configured guard and passes a short-lived session cookie to Chromium. Raw cookies, tokens, and passwords are never accepted, logged, or stored in history, and the previous auth state is restored after the scan. Authenticated scans require a persistent session driver (file, database, or redis); the array driver cannot share sessions with the scanner browser. When LENS_FOR_LARAVEL_AUTH_ALLOWED_IDS is set, only those ids may be used.

Interface languages

Version 3 ships complete package-owned interface catalogs for English, Polish, Spanish, French, and German. The selected language covers the scanner, history and URL-aware comparisons, AI Fix editor and Fix All queue, preview modals, interactive-state recorder, PDF reports, chart labels, and package-generated browser, route, interaction-script, baseline, and CLI error messages. The dashboard language switcher stores its choice in the session; exported PDF reports use that same language. Console errors use the Laravel application locale active for the command.

locale defines the initial language, fallback_locale is used when a translation is unavailable, and supported_locales controls the choices displayed in the dashboard. Accessibility-rule descriptions returned by axe-core and framework validation messages can still follow the language supplied by those upstream libraries rather than Lens's catalog.

Supported editors:

Supported AI providers:

Disable AI Fix explicitly while keeping all scanning features enabled:


Crawling

Whole-site scans discover URLs in this order:

  1. sitemap.xml
  2. sitemap_index.xml
  3. sitemaps/sitemap.xml
  4. internal <a href> links

By default, crawling uses Laravel's HTTP client and parses the initial HTML. This is fast and works well for Blade, Livewire, and server-rendered pages.

For SPA or Inertia apps where links are rendered after JavaScript hydration:

With that enabled, Lens attempts to render each crawled page in Chromium and collect links from the hydrated DOM. If browser crawling fails or finds no links, it falls back to the HTTP crawler.

Limit the crawl size with:


AI Fix

AI Fix is available only when all of the following are true:

On older supported applications, only AI Fix is disabled. The accessibility scanner and every non-AI feature remain available.

The AI Fix workflow:

  1. Lens locates the source file and line.
  2. It extracts the smallest relevant element or component instead of an arbitrary line window.
  3. It sends the issue, failing DOM snippet, WCAG tags, and selected source fragment to the configured AI provider.
  4. A dedicated accessibility agent returns a minimal replacement and explanation.
  5. The dashboard shows a diff preview.
  6. You can accept the proposal as generated or edit it directly in the modal. The built-in editor includes line numbers, indentation shortcuts, a live diff, and an option to restore the AI version.
  7. Fix All A and Fix All AA create review queues for every located issue at the selected level. Lens generates up to three suggestions concurrently, opens the queue immediately, and lets you move between ready suggestions while later items continue loading. One bulk action then applies every ready suggestion with its reviewed or edited code, and per-item failures are reported without stopping the rest.
  8. Each queued fix keeps its own generated, edited, rejected, failed, or applied state. A failed suggestion can be retried without restarting the rest of the queue.
  9. Lens applies each reviewed replacement after running the same path and dangerous-code checks for both generated and edited proposals.
  10. The issue is immediately marked AI Fix applied - pending re-scan while remaining in the violation counts until a new axe-core scan verifies the result.

Since v3.0, the agent uses a 12000-token output ceiling and a reduced Gemini thinking budget, and leaves temperature at the provider default so models without temperature support keep working. Gemini, OpenAI, Anthropic, OpenRouter, xAI, DeepSeek, and Mistral use the default model configured in laravel/ai unless LENS_FOR_LARAVEL_AI_MODEL sets an explicit model at your own responsibility. In v3.3, Ollama can use the exact local model tag from LENS_FOR_LARAVEL_AI_OLLAMA_MODEL; when both model settings are empty, the Laravel AI SDK default is used. The dashboard reports whether AI Fix uses the default AI SDK model or a manually configured model name. If the provider reaches its token limit or returns malformed structured output, Lens performs one controlled retry. Persistent failures produce a safe, understandable message; provider, resolved model, finish reason, and token usage are recorded in the application log without logging the submitted source fragment.

Privacy: AI Fix sends the failing DOM snippet, accessibility issue details, WCAG tags, and a bounded element/component source fragment to the configured provider. With Ollama's default localhost endpoint, this data stays on the machine running the Laravel application. A remote Ollama endpoint and cloud providers receive that bounded context over the network. Lens does not send the entire repository; review the selected context for secrets or sensitive information before requesting a fix.

Configure provider credentials:

To use a specific model instead of the SDK default, set an explicit model at your own responsibility (for example gpt-5.6-luna for OpenAI). An empty value keeps the SDK default behavior.

To run AI Fix locally, install Ollama, then pull a code-capable model:

Ollama serves http://127.0.0.1:11434 by default, so the URL can normally be omitted. laravel/ai 0.3.x names the optional URL override OLLAMA_BASE_URL; current releases use OLLAMA_URL. The selected model must already be present in ollama list. Larger code models can improve suggestions but require more memory and take longer to answer.

To test the full local workflow, run curl http://127.0.0.1:11434/api/tags, clear Laravel's cached configuration with php artisan optimize:clear, and add a known violation such as <img src="logo.png"> to a rendered page. Scan it in the dashboard, request AI FIX, and verify that storage/logs/laravel.log records provider ollama and the selected model without recording the source fragment. Review and apply the proposal, confirm the issue stays marked as pending, then re-scan to let axe-core verify the result.

Supported writable files:

AI Fix does not write outside those paths.


IDE Integration

When a source location is found, click it in the dashboard to open your editor at the exact line.

Use none to disable editor links:


Scan Output

Each issue includes fields like:

sourceType can be:


Security

Lens is intended for local and controlled development environments.

Built-in protections:

Recommended production posture:

If you enable Lens on staging, protect the route with authentication middleware:


Known Limitations

axe-core automates many high-confidence accessibility checks, but neither axe-core nor Lens can determine full WCAG conformance. A clean scan is evidence from automated checks, not proof that the application is fully accessible.

Source location is heuristic. Lens can locate many common Blade, Livewire, React, Vue, and Inertia patterns, but it may miss or misidentify:

For interactive states, run targeted scans after exposing the state, add dedicated URLs, or combine Lens with manual QA.

Always complement Lens with:


Upgrade Notes for v3.0 through v3.5

v3.5 is the current development line. Its new features are an optional explicit AI model override and dashboard info about the active AI Fix model. It requires no migration.

New in v3.5:

If the Lens config was published before v3.5, add:

v3.4 added authenticated scans for pages behind login and four additional AI Fix providers. It requires no migration.

New in v3.4:

If the Lens config was published before v3.4, add:

v3.3 added local AI Fix models through Ollama. It requires no migration.

New in v3.3:

If the Lens config was published before v3.3, add:

New in v3.2:

Added in v3.1:

The v3.0 foundation includes:

After upgrading from v2 to v3.0:

If you published the config before v3.0.0, add:

Install the optional AI SDK only on a supported runtime when AI Fix is needed:

Historical: Upgrade Notes for v2.0.0

Version 2 adds major frontend support and persistence features:

After upgrading:

If you already published the config, manually add:


Testing This Package


License

The MIT License (MIT). See LICENSE.md for details.


All versions of lens-for-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
spatie/browsershot Version ^4.0|^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webcrafts-studio/lens-for-laravel contains the following files

Loading the files please wait ...