# After a deploy

Source: https://laraport.app/docs/deploy/

> See pending migrations on the container's card, then run migrations, optimize, clear caches, restart queue workers or switch maintenance mode.

After a deploy you usually check a few things and run a few commands: are the migrations through, are the caches built, do the workers run the new code. laraport puts both in the container screen.

## Migrations on the card

The container card of a Laravel app shows its migrations, read with `php artisan migrate:status`, which changes nothing:

- `✓ all 42 ran`;
- or `⚠ 2 pending`, with the name of the first pending migration.

It sits next to the other warnings from `artisan about`: **DEBUG ON**, **DOWN** for maintenance mode, and uncached config or routes in production. See [Container screen](https://laraport.app/docs/container-screen/#summary).

## Deploy commands

*Screen: The Laravel tab with the deploy commands below Environment*

The Laravel tab lists the commands a deploy needs, below Environment:

| Action | Command |
|---|---|
| **Run migrations** | `php artisan migrate --force`. The menu says what is pending |
| **Optimize** | `php artisan optimize`: caches config, routes, views and events |
| **Clear caches** | `php artisan optimize:clear`: clears those caches and the application cache |
| **Restart queue workers** | `php artisan queue:restart`, plus `php artisan horizon:terminate` where Horizon is installed |
| **Maintenance mode on** / **off** | `php artisan down` or `php artisan up`, whichever applies |

Each asks first and shows the exact command and what it does. **Run migrations** also lists the pending migrations. On the production app, every confirmation says so.

Restarting the workers makes them finish their current job and exit. Your process manager (supervisor, Swarm, or Horizon's own supervisor) starts them again with the new code.

Back on the container, the card is read again, so caches, maintenance mode and migrations show the result.

The commands are recorded in the [journal](https://laraport.app/docs/journal/). A [read-only server](https://laraport.app/docs/read-only/) refuses them.

## Related

- [Swarm and Compose](https://laraport.app/docs/swarm-compose/): redeploy, roll back or scale a Swarm service; pull and recreate a Compose service.
- [Events](https://laraport.app/docs/events/): which containers died or restarted during the deploy.
- [Logs](https://laraport.app/docs/logs/#errors-summary): the errors the new release logs.
