Skip to content

After a deploy

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.

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.

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. A read-only server refuses them.

  • Swarm and Compose: redeploy, roll back or scale a Swarm service; pull and recreate a Compose service.
  • Events: which containers died or restarted during the deploy.
  • Logs: the errors the new release logs.