mohammed-mojaly/laralyze
Laralyze is a Laravel analysis package that inspects your app’s structure, routes, models, and database to surface useful insights. Use it to audit projects, understand dependencies, and spot optimization opportunities with clear, actionable reports.
Laralyze is a self-hosted observability dashboard: it records request, job, query, exception, log, cache, AI, and outbound HTTP activity into a store you control, then renders it in a Laravel-served UI. Treat it as "Telescope/Horizon, but with a dashboard you own and a ClickHouse option for volume."
composer require mohammed-mojaly/laralyze
php artisan vendor:publish --tag=laralyze-config # name may differ; check the provider
php artisan migrate
If the package ships an install command (e.g. php artisan laralyze:install), prefer it — it typically publishes config, migrations, and the dashboard assets in one pass.LARALYZE_ENABLED=true
LARALYZE_DRIVER=database # or clickhouse
LARALYZE_PATH=laralyze # dashboard route prefix
# ClickHouse driver:
LARALYZE_CLICKHOUSE_HOST=...
LARALYZE_CLICKHOUSE_DATABASE=laralyze
config/laralyze.php — driver, sampling rate, retention, redaction/ignore lists, watcher toggles. This file is the whole product surface.Driver selection as a scaling decision, not a preference.
database driver: fine for local, staging, and small production apps. Point it at a separate connection so ingestion doesn't compete with your app's primary queries.clickhouse driver: use when you're writing more than a few hundred thousand records a day or need fast range queries over weeks of data. Budget for running ClickHouse itself (container or managed) and for a second migration path — the package's migrations for ClickHouse are typically run through its own command, not php artisan migrate.Sampling per environment.
// config/laralyze.php
'sampling' => [
'requests' => env('LARALYZE_SAMPLE_REQUESTS', 1.0),
'queries' => env('LARALYZE_SAMPLE_QUERIES', 0.1),
],
Keep local at 1.0, production requests at 0.05–0.2, and queries lower still. Queries are the highest-volume signal by an order of magnitude.
Queue the write path. If the config exposes an async/buffered ingestion mode, turn it on in production. Synchronous inserts add latency to every request and turn a database hiccup into an application outage. Pair it with a flush on terminate so the last records of a request survive.
Context propagation is your job. The dashboard is only useful when you can answer "which user, which tenant, which job?" Attach context in a middleware (user ID, tenant ID, request ID) and ensure queue workers re-establish it per job. In Octane or long-running Horizon workers, state left over from a previous job will otherwise bleed into the next one's trace — reset context at the start of each job.
Custom instrumentation. If the package exposes a facade or helper for manual spans, wrap it in your own thin service class rather than calling it from dozens of places. That gives you a single place to no-op it when the package's API changes, and a single place to enforce redaction.
Alerting on top of the dashboard. A dashboard nobody opens is decoration. Wire the exception and slow-query thresholds into your existing alerting (Slack/webhook) so the dashboard becomes the drill-down after the page, not the detection mechanism.
Retention as a scheduled concern. Configure a retention window and confirm the prune command is actually scheduled in routes/console.php or the scheduler. Unpruned observability tables are a classic way to fill a disk quietly.
auth middleware and a gate/ability check to the route prefix. Never expose it on a public host without that. In production, consider IP allowlisting or a separate internal hostname.database driver writes to your primary connection, you're adding writes to the same pool serving users. Use a dedicated connection and, ideally, a dedicated schema.phpunit.xml env exclusions (LARALYZE_ENABLED=false) or you'll pay migration and ingestion costs on every test run and pollute your traces.composer.json, read the changelog before upgrading, and keep any custom instrumentation behind your own wrapper.LARALYZE_ENABLED true in that environment → is the relevant watcher toggled in config → did the queue worker pick up a stale config (restart workers after config changes) → is sampling set to 0 → is the redaction/ignore list swallowing the record.How can I help you explore Laravel packages today?