// Open source package

PageSpeed Watcher

Apogee-Information-Systems / pagespeed-watcher

Open-source Laravel package to run Google PageSpeed Insights (PSI) checks for your app pages. Schedule performance tests, discover routes into watcher_pages, track daily API usage, and run PSI from Artisan commands, all backed by a ready-made database schema. Supports Laravel 11, 12, and 13.

// Features

  • CLI commands for page tests, batch runs, route discovery, and API usage
  • Retries with exponential backoff for transient PSI failures
  • Daily usage tracking with cost estimates beyond the free tier
  • Core metrics including LCP, INP, CLS, TBT, and Speed Index
  • Database schema for pages, test results, settings, and API usage
  • Laravel Scheduler-friendly watcher:run-tests and route discovery

// Quick start

composer require apogee/laravel-pagespeed-watcher

php artisan vendor:publish --tag=watcher-config
php artisan vendor:publish --tag=watcher-migrations
php artisan migrate

php artisan watcher:test-page
php artisan watcher:usage
php artisan watcher:discover-routes
php artisan watcher:run-tests

// Commands

watcher:test-page

Run a full PageSpeed Insights test and analyse page performance. Every call consumes API quota; PSI has no separate validation endpoint. Supports --strategy=mobile|desktop, --url=, and --json.

watcher:usage

Monitor your PageSpeed Insights API usage: today's totals and the last seven days with cost estimates. Supports --json.

watcher:discover-routes

Sync Laravel GET routes into watcher_pages using configurable include/exclude patterns.

watcher:run-tests

Run PSI for active stored pages (--strategy=mobile|desktop|both, --pages=all|ids, --json) and persist results.

APOGEE INFORMATION SYSTEMS · Greece · Luxembourg · GitHub