Start Guide
Get started with Laravel Nightwatch
Welcome to Nightwatch. This guide will help you set up Nightwatch monitoring for your Laravel application in just a few minutes.
Registering an account
Visit nightwatch.laravel.com and register for a free account.
After registering, you’ll be redirected to the organization creation page. From here, you can create a new organization or join an existing one if you have a pending invite.
Creating an Organization
For a free account, you can get started with as little as an organization name. You can always upgrade and add more details later.
If you’re joining an existing organization, you’ll need to ask the owner to invite you.
Creating an Application
Access your dashboard
Go to nightwatch.laravel.com and log in to your account.
Create a new application
Click + New Application and provide the following:
- A name for your application
- A data region (US or EU)
- Details for your default environment (e.g. name, type)
Get your environment token
Once your application and its first environment are created, you’ll receive an environment-specific token. This token is required to authenticate the agent and send data to Nightwatch.
Forgot to copy the token? No problem — you can find it anytime on the environment details page.
Running the Agent
Install the package
Add Nightwatch to your Laravel application using Composer:
Add your token
Add your environment’s NIGHTWATCH_TOKEN
to your .env
file:
You will find these values in your Nightwatch dashboard upon creating an application.
Run the agent
The agent must be actively running to collect and send data to Nightwatch. Start the agent using the following Artisan command:
We strongly recommend using a process monitor to ensure the agent stays running in the background. We’ve created guides for Laravel Cloud and Laravel Forge to help you get started.
To monitor the health of the running agent, you may run the php artisan nightwatch:status
command to ensure the agent is able to accept connections. The status command will exit with a non-zero status code in the event of an error.
Verify Your Connection
After the agent has been running for a few minutes, you will see your data appear in the Nightwatch dashboard.
Support
Need help? Visit our support page for more information.