Events are the fundamental building blocks of observability in Nightwatch. Each event captures a single activity, such as a database query, an API call, an email sent, or an exception thrown. Nightwatch connects these events to reveal the complete journey through your application. When debugging an error, you trace its exact path from origin to failure. When investigating slow performance, you identify precisely which queries, cache operations, or external services are the bottleneck. This depth of visibility provides unparalleled insight into improving your application.Documentation Index
Fetch the complete documentation index at: https://nightwatch.laravel.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Event types
Nightwatch automatically captures these core event types, each with comprehensive contextual data:- Requests: HTTP requests handled by your application
- Queries: Database queries and transactions
- Outgoing Requests: HTTP calls to external APIs
- Jobs: Queued jobs and their execution
- Scheduled Tasks: Scheduled command executions
- Commands: Artisan commands run via CLI
- Cache: Interactions with your application cache
- Mail: Mail sent from your application
- Notifications: Notifications sent from your application
- Exceptions: Errors and exceptions thrown
- Logs: Application log entries
Execution contexts
Events connect together through an execution context — the origin point that triggered a chain of related activities. When a request enters your application, it becomes the execution context. All subsequent events (queries, cache operations, jobs, API calls, exceptions) are linked as children, creating a complete timeline of what happened. In Laravel applications, there are three types of execution contexts:- HTTP Requests: A user visits a page or an API endpoint is called
- Artisan Commands: A command is run from the CLI
- Scheduled Tasks: A scheduled job executes via Laravel’s scheduler