Integration guides

Laravel Cloud deployment hook

Set up DeployState with Laravel Cloud

Keep deployment state next to your Laravel Cloud release. A private DeployState hook starts before the release work and closes when the deployment hook succeeds.

01 / Configure the platform

Put the hook beside the deployment work.

Find Application → Deployment hooks and environment variables. The exact commands stay in the tool you already trust; DeployState only receives the lifecycle signal before and after it runs.

  1. 01

    Create one step per release concern

    Start with a single application step. Add separate steps later for workers, a frontend build, or another service.

  2. 02

    Add the private URL to Cloud secrets

    Save the copied base URL as DEPLOYSTATE_HOOK_URL. Treat it exactly like another deployment secret.

  3. 03

    Use two deployment hooks

    Call /start before the release begins and /complete after it succeeds. A non-zero hook command keeps the deployment failure visible.

02 / Shell example

A single private base URL, three possible states.

Add the start request to the hook that runs before your release work. Add the complete request to the final successful deployment hook.

ShellDEPLOYSTATE_HOOK_URL
# Before deployment
curl --fail --silent --show-error -X POST "$DEPLOYSTATE_HOOK_URL/start"

# After deployment
curl --fail --silent --show-error -X POST "$DEPLOYSTATE_HOOK_URL/complete"

Set DEPLOYSTATE_HOOK_URL to the private URL copied from a step, for example https://your-deploystate-url/api/v1/hooks/{step-token}. Append /start, /complete, or /fail exactly as shown.

If you choose a readable endpoint, store its URL and token separately: DEPLOYSTATE_HOOK_URL=https://your-deploystate-url/api/v1/production/deploy and DEPLOYSTATE_HOOK_KEY={step-token}, then add -H "X-DeployState-Key: $DEPLOYSTATE_HOOK_KEY" to each curl call.

03 / Protect the signal

Keep the credential in the platform’s secret store.

  • Do not paste a private hook into source control, an issue, or build output.
  • For a readable endpoint, keep DEPLOYSTATE_HOOK_KEY private even though the URL itself is safe to read.
  • Give each deploy concern its own step so one integration never needs another integration’s credential.
  • Rotate the hook from the DeployState step editor if it is exposed or no longer needed.

Ready to test

The next deployment will show up on its own.

Start free