---
title: Envoyer (Laracasts course)
kind: note
description: Link 01 - The First Deployment Current deployment in subdirectory Keeps last 6-7 releases in directory is a symlink to the latest release Web root should be set to 02 - Server Directory Structure…
words: 451
readingMinutes: 2
created: '2024-08-18T18:51:19+02:00'
updated: '2026-06-29T13:33:37+02:00'
website: https://laracasts.com/series/envoyer
---
## Link

<https://laracasts.com/series/envoyer>

## 01 - The First Deployment
- Current deployment in `current` subdirectory
- Keeps last 6-7 releases in `releases` directory
- `current` is a symlink to the latest release
- Web root should be set to `current/public`
## 02 - Server Directory Structure
- Deployment steps behind the scene:
	1. Create new directory named after the current date and time under `releases`
	2. Install dependencies
	3. Run deployment hooks, such as running migrations
	4. Switch symlink of `current` to the new directory
- `storage` is a symlink too
## 03 - Health Checks and Rollbacks
- Healthcheck can of course only be run after activating a new release, making it available to the public
- We can manually redeploy old versions by clicking a button in the interface
## 04 - Deployment Hooks
- Available hooks - before and after:
	- Clone New Release
	- Install Composer Dependencies
	- Activate New Release
	- Purge Old Releases
- Can select which server(s) to run on (e.g. migrations should not be run on multiple servers)
- [Variables](https://docs.envoyer.io/projects/deployment-hooks.html#hook-variables) which will be replaced in hook scripts (remove the additional spaces between the brackets) include:
	- `{ { release } }` => current release directory
## 05 - When Deployment Scripts Break
- Deployment gets canceled, a warning icon appears on the dashboard
## 06 - Multi-Server Deployment
- Each deployment step (e.g. the built-in or hooks) has to complete successfully on all servers, before [Envoyer](/notes/envoyer-service) begins the next.
- Remember to modify hooks so they run on all servers where they are required (e.g. migrations should not be run on multiple servers)
## 07 - Notifications
- [Notifications](https://docs.envoyer.io/projects/notifications.html) can be sent to:
	- <span class="dead-link">Slack</span>
	- [Email](/notes/email)
	- [Discord](/notes/discord)
	- <span class="dead-link">Microsoft Teams</span>
- Whenever:
	- Deployment completes (whether successfully or not)
	- Post-deployment healthcheck fails
	- Heartbeat fails
## 08 - Heartbeats
- Notifies when a scheduled task (cron job) has not run when expected.
- When using a regular cron job (i.e. configured in some user's `crontab`), append ` && curl https://beats.envoyer.io/heartbeat/XXX` to the command to ping Envoyer. `&&` makes the `curl` command run only if the previous command(s) exited with code 0 (i.e. successfully).
- When using [Laravel](/notes/laravel), we can use the [thenPing()](https://laravel.com/docs/10.x/scheduling#pinging-urls) method to request the heartbeat URL.
### Alternatives
- [thenping.me](https://thenping.me/)
## 09 - Environment Management
- The "Manage environment" button allows to deploy an `.env` file across all servers.
- The contents are stored in the Envoyer service, but are encrypted with a key that they do not store (so it has to be entered for each modification of the `.env` contents).
- It is put in the project root on the server, and symlinked to from each new release folder.
## 10 - Collaborators
- Collaborators have to sign up for [Envoyer](/notes/envoyer-service) before they can be invited, but they do not have to pay for the service.
- Collaborators are invited per project, using the email address they registered with.
- Invitations have to be accepted by the collaborator.
- Collaborators can deploy, modify settings, add deployment hooks and heartbeats, but cannot add additional collaborators nor delete the project.