pascalkleindienst/laravel-glimpse
Laravel Glimpse is a lightweight package that gives you quick, at-a-glance insight into your application. It integrates cleanly with Laravel, needs minimal setup, and helps developers surface useful information during development without leaving their workflow.
laravel-glimpse is a lightweight page-view/analytics package. This release (v0.5.1) is a patch release — three bug fixes, no new API surface and no breaking changes — so it's a safe in-place upgrade from v0.5.0. If you are adopting the package now, start on ≥ v0.5.1 to avoid the schema and scheduler issues described below.
Minimal steps
composer require pascal-kleindienst/laravel-glimpse
php artisan vendor:publish --tag="glimpse-config"
php artisan vendor:publish --tag="glimpse-migrations"
php artisan migrate
Confirm the published tags and namespace against the package README — the vendor name is derived from the repo owner, so let composer show be the source of truth.glimpse_page_views table whose indexes were created cleanly. If the migration errored with an index-length or duplicate-index error, you are on a stale published migration (see Gotchas).php artisan schedule:list. As of v0.5.1 the package's maintenance commands are auto-registered, so there should be glimpse:* entries without you adding anything to routes/console.php or Kernel::schedule().glimpse_page_views. Once you can see raw rows, start reading them through the package's query/reporting layer rather than hand-rolling SQL.Where to look first
config/glimpse.php — enable/disable switch, retention, and any tracking filters. This is the file you will touch most.database/migrations/*glimpse* — tells you exactly which columns and indexes you can query and aggregate on.src/Console/ — the scheduler commands that v0.5.1 fixed the autoregistration for; read their signatures to understand what runs and when.Tracking
/admin, /nova, /horizon, health checks, or asset routes.config/glimpse.php. Filtering at the config layer survives route refactors; if statements sprinkled through middleware don't.Reading the data
glimpse_page_views for anything the package doesn't ship. Typical shapes: views per path per day, unique visitors per period, top referrers, entry pages.glimpse_page_views on every dashboard load.Scheduling
$schedule->command('glimpse:...') entry creates duplicate executions — usually harmless, occasionally not (double pruning is fine, double aggregation is not).* * * * * php artisan schedule:run in cron, or php artisan schedule:work locally/in containers.php artisan schedule:list and diff against what you previously registered manually, then delete your old entries.Testing
phpunit.xml via the config flag, or the middleware will write rows during every feature test and slow the suite.RefreshDatabase and assert against glimpse_page_views directly for the small number of tests that cover tracking behaviour. Keep it to a couple of tests — don't couple your suite to the package's internal schema more than necessary.Upgrading from v0.5.0 — the migration fixes
migrations table and won't re-run. Write a small corrective migration that drops the old index by its misspelled name and adds the corrected one, or re-publish and hand-edit if you haven't shipped to production yet.down() path will reference an index name that no longer matches reality, so migrate:rollback will fail with "can't drop index" errors. Drop by the old name explicitly in your corrective migration.utf8mb4 costs 4 bytes per character, and older InnoDB builds cap index keys at 767 bytes, so an indexed VARCHAR(255) URL column blows up at migrate time. v0.5.1 fixes the definition, but it's worth checking your own added indexes on that table against the same limit — if you're on MySQL < 5.7.7 or MariaDB < 10.2.2, shorten the column or index a prefix. Setting Schema::defaultStringLength(191) in AppServiceProvider is the blunt instrument if you hit this elsewhere.glimpse_page_views and re-run rather than trying to patch it incrementally.Scheduler
schedule:list is empty of glimpse entries. After upgrading, confirm the entries appear. If they still don't, you likely have a cached config or a cached schedule: run php artisan config:clear and php artisan optimize:clear.->onOneServer() semantics yourself if the package commands aren't already guarded — duplicate aggregation across nodes is the failure mode to watch for.Config and debugging
php artisan config:clear (or optimize:clear) after touching config/glimpse.php. Cached config silently ignores your changes and is the number-one cause of "tracking isn't working."php artisan route:list -v on a target route), then whether your exclusion rules are matching more broadly than intended.Version pinning
^0.5.1 rather than ^0.5 and read the release notes for each 0.5.x. A patch-level migration change is unusual, and any future schema change will require the same corrective-migration dance described above.How can I help you explore Laravel packages today?