Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
What is Laravel Nightwatch
Laravel Nightwatch is a hosted SaaS monitoring platform for Laravel applications. It continuously collects telemetry from your production environment — HTTP requests, SQL queries, exceptions, queued jobs, logs, and scheduled tasks — and surfaces that data in a real-time cloud dashboard.Nightwatch is a paid service (monthly subscription). A free plan is available, but it has a monthly event limit. Without the right configuration, the free plan fills up quickly. The settings in the “Free plan tips” section below are essential.
How Nightwatch differs from Telescope and Pulse
Nightwatch occupies a different role than the other Laravel observability tools. Here is how they compare.| Tool | Purpose | Hosting | Environment |
|---|---|---|---|
| Telescope | Debug requests and queries while developing | Inside your app | Local development |
| Pulse | Aggregate performance metrics | Inside your app | Production / staging |
| Nightwatch | Real-time monitoring and alerting | Laravel-hosted SaaS | Production |
Architecture
Nightwatch uses a lightweight agent process between your Laravel application and the Nightwatch cloud. The agent listens locally on port2407 (configurable), receives events from the Laravel application, and batches them to the Nightwatch cloud. The agent must run continuously alongside your application.
Installation
1. Register an account and create an application
Visit nightwatch.laravel.com, register for a free account, and create an organization and an application. After creating the application you will receive an environment token.2. Install the package
--dev flag. Nightwatch is designed for production use.
3. Add your token
Add the environment token to your.env file.
4. Start the agent
5. Disable Nightwatch in tests
Disable Nightwatch when running your test suite to avoid polluting your monitoring data.phpunit.xml to keep it consistent across environments.
Free plan tips
Lower the request sample rate
NIGHTWATCH_REQUEST_SAMPLE_RATE defaults to 1.0 (every request). Set it to 0.1 (10 %) to reduce the volume by 90 % while still getting a representative picture of your application’s behavior.
Disable query collection
Database queries account for a large share of total events. Disabling them frees up your monthly allowance for higher-value events like exceptions, requests, and jobs.Other filtering options
You can also disable specific event categories you do not need.Recommended free plan configuration
Key features
Request monitoring
Nightwatch records each HTTP request with response time, status code, and route details. Use the dashboard to identify slow endpoints and performance regressions over time.Exception tracking
Every unhandled exception is captured in real time, complete with a stack trace and an inline source code snippet. You can link exceptions to Linear issues directly from the dashboard.Log aggregation
Nightwatch integrates with Laravel’s logging system. Structured log entries are forwarded alongside your application events.Job and scheduled task monitoring
Track the execution history, success or failure status, and duration of queued jobs and scheduled tasks. Failures surface immediately without having to dig through log files.Deployment tracking
Deployments are recorded alongside your monitoring data. This makes it straightforward to correlate a spike in exceptions or a slowdown with a specific release.Alerts and notifications
Connect Slack or configure webhooks to receive real-time alerts when error rates spike or performance degrades.When to use Nightwatch vs. Telescope vs. Pulse
- Local development → Telescope
- Aggregated production metrics on your own infrastructure → Pulse
- Detailed production traces and alerts without managing infrastructure → Nightwatch
Summary
Laravel Nightwatch gives production Laravel applications the same level of observability that Telescope provides locally — without needing to manage the monitoring infrastructure yourself. To get the most out of the free plan:- Set
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1to collect a representative 10 % sample of requests - Set
NIGHTWATCH_IGNORE_QUERIES=trueto conserve your monthly event allowance - Keep the agent running continuously using a process monitor
Laravel Telescope: Practical Dev Techniques
For local development debugging, use Telescope.