Download the PHP package rawand201/filament-spatie-lighthouse without Composer

On this page you can find all versions of the php package rawand201/filament-spatie-lighthouse. 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 filament-spatie-lighthouse

Filament Spatie Lighthouse

Latest Version on Packagist Total Downloads PHP Version

A Filament plugin that integrates spatie/lighthouse-php to run Google Lighthouse audits directly from your admin panel — view scores, performance metrics, failed audits, audit history, and full HTML reports without leaving Filament.

Demo


Table of Contents


Requirements

Requirement Version
PHP ^8.2
Laravel ^11.0 \| ^12.0
Filament ^4.0 \| ^5.0
spatie/lighthouse-php ^2.0
Node.js ^18.0 \| ^20.0 \| ^22.0
lighthouse (npm) ^12.0
Chrome / Chromium any recent version

Note: The lighthouse npm package must be installed on the server. Run:

Then verify: npx lighthouse --version

spatie/lighthouse-php also requires a Chromium-based browser. See their documentation for full setup.


Installation

1. Install the package:

2. Publish and run the migration:

3. (Optional) Publish the config file:

4. Register the plugin in your Filament panel provider:

That's it. A "Lighthouse Results" page will appear in your panel's navigation.


Basic Usage

Once installed, navigate to the Lighthouse Results page in your Filament panel. Enter a URL and click Run Audit. The plugin will:

  1. Run a Lighthouse audit via spatie/lighthouse-php
  2. Save the results (scores + raw data)
  3. Display category scores, performance metrics, and failed audits

Each row in the results table has actions to:


Plugin Options

Customise the plugin when registering it in your panel provider:

All available methods

Method Type Default Description
navigationGroup(string\|Closure\|null) static translation key Navigation group label
navigationLabel(string\|Closure\|null) static translation key Nav item label
navigationIcon(string\|Closure) static heroicon-o-chart-bar Nav item icon
navigationSort(int\|Closure) static 1 Sort order within group
authorize(bool\|Closure) static true Access control callback
usingPage(string) static LighthouseResults::class Custom page class

Configuration Reference

After publishing, edit config/filament-spatie-lighthouse.php. Below is the full reference:

Result Store

Raw Results Storage

Controls where the large raw Lighthouse JSON (500KB–2MB per audit) is saved:

See Raw Results Storage for details.

Database

Cache

Audit Timeout

History Retention

Default Audit Categories

Queue

Score Thresholds

Controls the colour indicators on score badges:

Metric Thresholds

Controls the colour indicators on individual performance metrics:

Display Options

Fine-grained control over which UI sections are shown:

Export

Scheduling

Notifications

REST API Endpoints


Raw Results Storage

Each Lighthouse audit produces a raw JSON result of 500KB–2MB. By default this is stored in a raw_results database column. For production deployments with frequent audits, this can bloat your database significantly.

The plugin supports opt-in filesystem storage — the raw JSON is written to disk (or any Laravel filesystem disk including S3) and only the file path is stored in the database.

Enable filesystem storage

In .env:

Or in config/filament-spatie-lighthouse.php:

How it works

Mode raw_results column raw_result_path column
database (default) Full JSON blob null
filesystem null Path on disk (e.g. lighthouse-results/abc123-2025-01-01.json)

The HTML report view and download actions transparently resolve the raw results from either location — no change is needed to how you use the plugin.

Tip: You can mix both modes in the same database — existing records with raw_results continue to work after you switch to filesystem.


Queue Support

Running Lighthouse synchronously blocks the web request for up to 3 minutes. For production use, queue audits in a background worker.

Enable queue mode in .env:

Then run a queue worker:

When queue mode is enabled, clicking "Run Audit" in the UI dispatches a RunLighthouseAuditJob. The table polls every 30 seconds by default (configurable via display.table_poll_interval) and updates when the job completes.

Dispatching manually


Scheduled Audits

The plugin registers its own schedule using Laravel's Schedule facade — you do not need to modify your app/Console/Kernel.php.

Configure URLs to audit on a schedule:

Make sure the Laravel scheduler is running:

Supported frequencies: hourly, daily, weekly.

You can also dispatch a one-off scheduled job from the command line:


Notifications

The plugin can send notifications when an audit completes or fails.

Email

The email includes the URL, all four category scores, and a timestamp.

Slack

The Slack attachment is colour-coded based on the performance score (green ≥ 90, orange ≥ 50, red < 50).


REST API Endpoints

The plugin exposes optional read-only HTTP endpoints for fetching audit results programmatically.

Enable in config:

Authenticate requests by passing the token in a header or query string:

Available endpoints

Method Endpoint Auth Description
GET /{prefix}/health No Health check
GET /{prefix}/latest?url=... Yes Latest result for a URL
GET /{prefix}/results Yes All results (paginated)
GET /{prefix}/results/{id} Yes Single result by ID

Artisan Commands

lighthouse:audit

Run an audit synchronously and display a score table in the terminal:

lighthouse:schedule

Dispatch an audit job to the queue:

lighthouse:list

List recent audit results:

Auto-pruning old records

The LighthouseAuditResult model uses MassPrunable. Add this to your scheduler (or run manually):

Records older than keep_history_for_days days (default: 30) are deleted.


Events

The plugin dispatches three events during the audit lifecycle. All events are queue-safe (no non-serializable objects).

Event When Properties
AuditStartingEvent Just before the audit runs $url, $categories, $formFactor, $userId
AuditEndedEvent Audit completed successfully $url, $scores (array, 0–100 per category), $userId
AuditFailedEvent Audit threw an exception $url, $exception, $userId

Listening to events


Custom Result Store

Implement the ResultStore interface to plug in any storage backend (Redis, DynamoDB, etc.):

Bind it in a service provider:

StoredAuditResults constructor


Extending the Page

To override any behaviour on the Lighthouse Results page, extend the base class:

Register it via the plugin:


Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.


Credits

See CREDITS.md for the full list.


Changelog

See CHANGELOG.md.


License

MIT — see LICENSE.


All versions of filament-spatie-lighthouse with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0|^5.0
spatie/lighthouse-php Version ^2.0
spatie/laravel-package-tools Version ^1.9
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 rawand201/filament-spatie-lighthouse contains the following files

Loading the files please wait ...