This package provides a wrapper for Google Lighthouse to audit the quality of web pages with Laravel.

Overview

laravel-google-lighthouse

Latest Stable Version Total Downloads License PHP Version Require

This package is based on octoper/lighthouse-php.

This package provides a wrapper for Google Lighthouse to audit the quality of web pages with Laravel.

Installation

You can install the package via Composer:

composer require logiek/laravel-google-lighthouse

The package will automatically register itself. Optionally you can publish the config file with:

php artisan vendor:publish --provider="Logiek\GoogleLighthouse\GoogleLighthouseServiceProvider" --tag="config"

Usage

The following example will perform the default Google Lighthouse audit and store the result in the given path.

use Logiek\GoogleLighthouse\GoogleLighthouse;

(new GoogleLighthouse())
    ->setOutput('report.html')
    ->audit('http://example.com');

Categories

Per default the audit will run all the available categories. To run the audit for a specified list of categories you can specify the categories that the audit should run as shown in the example below, any missing category will be skipped.

The available categories are: performance, pwa, bestPractices, accessibility and seo.

use Logiek\GoogleLighthouse\GoogleLighthouse;

(new GoogleLighthouse())
    ->performance()
    ->pwa()
    ->setOutput('report.html')
    ->audit('http://example.com');

Output

The setOutput method accepts a second argument that can be used to specify the format (based on the configuration). If the format argument is missing then the file extension will be used to determine the output format. If the file extension does not specify an accepted format, an exception will be thrown.

For the example the following code will create two reports example.report.html and example.report.json.

use Logiek\GoogleLighthouse\GoogleLighthouse;

(new GoogleLighthouse())
    ->setOutput('example', ['html', 'json'])
    ->audit('http://example.com');

Options

The setOption method can be used to specify certain options to fine tune Google Lighthouse to your liking.

use Logiek\GoogleLighthouse\GoogleLighthouse;

(new GoogleLighthouse())
    ->setOption('--throttling.cpuSlowdownMultiplier', 4)
    ->setOutput('report.html')
    ->audit('http://example.com');

Changelog

Please see the CHANGELOG for more information about recent changes.

License

This project is open-sourced software licensed under the MIT license.

You might also like...
Enhance product data quality and streamline content creation with the Pimcore and ChatGPT integration.
Enhance product data quality and streamline content creation with the Pimcore and ChatGPT integration.

chatgpt-pimcore Enhance product data quality and streamline content creation with the Pimcore and ChatGPT integration. Overview The integration of Pim

Extracts information about web pages, like youtube videos, twitter statuses or blog articles.
Extracts information about web pages, like youtube videos, twitter statuses or blog articles.

Essence is a simple PHP library to extract media information from websites, like youtube videos, twitter statuses or blog articles. If you were alread

A PHP/Laravel package to fetch Notion Pages and convert it to HTML!

Generate HTML from Notion Page This package converts all the blocks in a Notion page into HTML using Notion's API. For more details on Notion API, ple

A package to render form fields in WordPress settings pages.

WP Settings Page Fields A package to render form fields in WordPress settings pages. You might need a settings page with a form and its fields and you

This package provides a simple and intuitive way to work on the Youtube Data API. It provides fluent interface to Youtube features.

Laravel Youtube Client This package provides a simple and intuitive way to work on the Youtube Data API. It provides fluent interface to Youtube featu

This plugin allows you to create many-to-many relationships between pages in Kirby and synchronizes them on both sides.
This plugin allows you to create many-to-many relationships between pages in Kirby and synchronizes them on both sides.

Kirby 3 Many To Many Field This plugin allows you to create many-to-many relationships between pages in Kirby.

Allow SVG images to be used in Magento CMS blocks and pages via the TinyMCE Wysiwyg Editor.
Allow SVG images to be used in Magento CMS blocks and pages via the TinyMCE Wysiwyg Editor.

Hyvä Themes - SVG support for the Magento CMS Wysiwyg Editor Allow SVG images to be used in CMS blocks and pages via the TinyMCE Wysiwyg Editor. hyva-

Rah cache - Cache Textpattern's dynamic pages as flat files

rah_cache Packagist | Issues Rah_cache is a simple, experimental full-page caching plugin for Textpattern CMS. It caches Texpattern’s dynamic pages as

Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pages from the admin panel.
Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pages from the admin panel.

Magento 2 Preview/Visit Catalog Overview Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pa

Releases(1.1.0)
Owner
Logiek
Logiek is an web agency from The Netherlands.
Logiek
A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.

A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.

null 16 Nov 11, 2022
Audit your PHP version for known CVEs and patches

PHP Version Audit PHP Version Audit is a convenience tool to easily check a given PHP version against a regularly updated list of CVE exploits, new re

Daniel 103 Dec 19, 2022
Pat if amp - ⚡ A Textpattern Conditional Plugin for Google's Accelerated Mobile Pages Project (AMP)

pat_if_amp Download | Packagist AMP pages for Textpattern CMS. This conditional tag examines the URL of the current page and determines if the URL end

Patrick LEFEVRE 4 Dec 15, 2019
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

⚗️ About Larastan Larastan was created by Can Vural and Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural, Nuno Maduro, and Vik

Nuno Maduro 4.4k Jan 4, 2023
Internal Quality Assurance Cell, IQAC Project Data Capturing System.

IQAC-DCS-2021 Added AQAR Directory with template pages! Old Readme Internal Quality Assurance Cell, IQAC Project Data Capturing System. Fork Repo Clon

Kashif Raza 4 Jan 4, 2022
PHP_Depend is an adaptation of the established Java development tool JDepend. This tool shows you the quality of your design in terms of extensibility, reusability and maintainability.

PHP Depend Documentation PHP Depend for enterprise Available as part of the Tidelift Subscription. The maintainers of PHP Depend and thousands of othe

PHP_Depend 837 Dec 14, 2022
The Barista explores every Latte (file) for strict quality, helps with Latte 2 to 3 upgrade

The Barista makes Your Perfectly Tasty Latte Do you drink Latte with your templates? Get it from Barista that knows his job: explore Latte via node vi

Tomas Votruba 5 Sep 7, 2022
Comprehensive Plugin for composer to execute PHP Quality assurance Tools

NOT MAINTANED ANYMORE The development of composer-plugin-qa was dropped in favor of phpqa which is actively maintained. The project use docker and can

Webysther Nunes 25 Apr 30, 2021
Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files

Quality Hook Installer Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files Install

Kay W. 2 Dec 15, 2022
WPForms coding standards are based on the WordPress Coding Standards and the PHPCompatibility Coding Standards and help create strict and high-quality code.

WPForms coding standards are based on the WordPress Coding Standards and the PHPCompatibility Coding Standards and help create strict and high-quality code.

Awesome Motive, Inc. 7 Nov 29, 2022