Deploying To Cloud
LaravelOfficialCreated by laravel
- Skill
- Tool integration
- Cloud and DevOps
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a comprehensive guide for using the Laravel Cloud CLI to deploy, manage, and monitor Laravel applications. It covers the full lifecycle of cloud-hosted applications, including environment configuration, resource provisioning (databases, caches, storage), secret management, and remote command execution. The skill emphasizes using the CLI for operational tasks, following specific flag patterns for non-interactive execution, and integrating with Laravel's native features like queues, schedulers, and object storage.
What it does
- Deploys Laravel applications to the cloud with zero-downtime switching.
- Manages infrastructure resources like databases, caches, and object storage buckets.
- Handles environment-specific configurations and secure secret management.
- Provides tools for remote execution, including Tinker and shell command runs.
- Monitors deployment status, logs, and organization-wide billing and usage.
- Configures domains, SSL, and edge cache purging for production environments.
When to use it
- When deploying a new Laravel application or updating an existing one.
- When provisioning or managing cloud resources like databases or storage buckets.
- When troubleshooting deployment failures or monitoring application health.
- When managing environment variables, secrets, or Resend email integrations.
- When needing to run remote PHP code or shell commands on a production environment.
Advantages
- Standardizes deployment workflows using the official CLI.
- Ensures non-interactive operations with consistent flag usage.
- Provides clear patterns for handling persistent storage and private/public file visibility.
- Enables secure, encrypted secret management at the organization level.
- Facilitates efficient monitoring and debugging of cloud-hosted applications.
Usage examples
- “Deploy my production environment for the app named 'my-laravel-app'.”
- The agent will execute 'cloud deploy my-laravel-app production -n --open' and subsequently run 'cloud deploy:monitor -n' to track the deployment progress.
- “How do I create a new database for my staging environment?”
- The agent will identify the correct database cluster and run 'cloud database:create --json -n' to provision the resource.
- “Check my current cloud usage and spend.”
- The agent will run 'cloud usage --detailed --json -n' to provide a breakdown of costs and resource consumption.
- “Run a tinker command to clear my cache on the production environment.”
- The agent will execute 'cloud tinker production --code="Artisan::call('cache:clear');" -n' to perform the task remotely.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/laravel/deploying-to-cloud/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip deploying-to-cloud.zip -d .agents/skills
Documentation by laravel
Deploying with Laravel Cloud
Use the Laravel Cloud documentation for detailed, current feature behavior. Use the Cloud CLI for Cloud operations rather than guessing dashboard or API workflows. Install it in the project and invoke it as ./vendor/bin/cloud by default; use a globally installed cloud command only as a fallback. Commands below are written as cloud for brevity; run them as ./vendor/bin/cloud unless falling back to the global installation.
Application Setup
Laravel Cloud deploys from GitHub, GitLab, or Bitbucket. A new Laravel application requires PHP 8.2 or later, Laravel 9 or later, a connected Git provider, and a deployment region.
Cloud creates environments for applications. Use separate production, staging, and preview environments; each environment has its own compute, resources, and deployment settings.
Keep application compute and attached resources in the same region where possible.
Cloud builds a Docker image using the selected PHP version, runs the configured build and deploy commands, and switches traffic to a successful deployment with zero downtime. Push-to-deploy is enabled by default, and manual deployments and deploy hooks are also available.
Build and Deploy
A typical Laravel build command is
composer install --no-dev && npm run build.Run optimization and cache-building commands during the build, not during deployment. A typical deploy command is
php artisan migrate --force.Build and deploy commands have a 15-minute timeout. Deploy commands run immediately before the release becomes live, and filesystem changes made by deploy commands are not persisted.
Do not add
php artisan queue:restart,php artisan horizon:terminate,php artisan optimize:clear, orphp artisan storage:linkto deploy commands. Cloud handles worker restarts and process management; deploy filesystem changes are not persistent.After changing environment settings, attached resources, or linked secrets, redeploy the environment for the changes to take effect.
Configuration and Resources
Attached databases, caches, and object storage inject their connection variables automatically. Custom environment variables take precedence over injected values.
Use Secrets Manager for encrypted organization-level values shared across environments. Secret values cannot be read after creation; redeploy affected environments after creating, updating, linking, unlinking, or deleting a secret.
Environment filesystems are ephemeral and are not shared between replicas. Use a database or Laravel Valkey for persistent cache and sessions, and Laravel Cloud Object Storage for persistent files. Do not rely on local files surviving a deployment.
Object Storage and File Visibility
Laravel Cloud Object Storage is backed by Cloudflare R2. R2 applies visibility at the bucket level; a bucket cannot contain a mix of private and public objects.
For private files, always use
Storage::disk()with no arguments, such asStorage::disk()->put(...), so Laravel uses the environment's default disk. Do not pass a disk name for private/default storage. Attach a private Cloud bucket as the environment's default disk.For public files, use the named public disk:
Storage::disk('public')->put(...). Attach a second Cloud bucket configured as public and give it thepublicdisk name.Applications that use both private and public files therefore need two Cloud Object Storage buckets attached to the environment: a private default bucket and a public bucket named
public.Do not set per-file or Flysystem
visibility: 'public'configuration for Cloud Object Storage. R2 does not support per-object ACL headers and rejects those requests; select the bucket visibility when creating the bucket.Private buckets are not internet-accessible, but Laravel can generate temporary public URLs with
Storage::temporaryUrl(...). Public buckets expose all objects through their Cloud-provided public URL.Install the S3 Flysystem adapter before using Cloud Object Storage:
composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies.
Queues and Scheduling
Managed queues are the recommended queue option. They provision dedicated workers and autoscale based on queued work.
Managed queues require a supported recent Laravel version and
aws/aws-sdk-php; check the current Cloud documentation before changing dependencies.Enable the scheduler on an App or Worker cluster to run
php artisan schedule:runevery minute. When an environment has multiple replicas, use Laravel'sonOneServerfor tasks that must run once.Only Flex compute sizes can scale to zero. Scale-to-zero environments wake for Laravel scheduled tasks and queued jobs, but long-running jobs may be interrupted when the sleep timeout is reached. Use managed queues for workloads that must not be interrupted.
Domains and Storage
Each environment receives a
laravel.clouddomain after its first successful deployment. Cloud automatically verifies custom domains and provisions SSL after the required DNS records are configured.Do not use the ephemeral filesystem for persistent uploads, generated files, cache, or session data. Use the appropriate Cloud resource instead.
Cloud CLI
Setup
composer require --dev laravel/cloud-cli
./vendor/bin/cloud auth -nIf a project-local installation is not available, install the CLI globally with composer global require laravel/cloud-cli and invoke it as cloud.
cloud auth opens a browser. If a browser is unavailable, set LARAVEL_CLOUD_TOKEN in the environment. It overrides any saved token and writes nothing to disk. To save a token instead, run cloud auth:token --add --token=<token> -n or pipe it with echo "$TOKEN" | cloud auth:token --add -n.
Commands
Commands follow a CRUD pattern: resource:list, resource:get, resource:create, resource:update, resource:delete.
Available resources: application, environment, instance, database-cluster, database, cache, bucket, domain, websocket-cluster, background-process, scheduled-command, secret, command, deployment.
Some resources have additional commands (e.g., domain:verify, database:open, instance:sizes, cache:types, database:types, <resource>:metrics). Discover these via cloud -h.
Never hardcode command signatures. Always run cloud <command> -h to discover options at runtime.
CLI Flags
Always add
-nto every command to prevent the CLI from hanging.Never use
-qor--silent; they suppress all output.
Flag combos per operation:
Read (
:list,:get) →--json -nCreate (
:create) →--json -nUpdate (
:update) →--json -n --forceDelete (
:delete) →-n --force(no--json)Environment variables →
-n --forceDeploy or ship →
-nwith all options passed explicitly (no--json)
Deployment Workflow
Determine the task and follow the matching path:
First deployment: inspect
cloud ship -h, then runcloud ship -nwith all required values.Existing application:
cloud deploy {app_name} {environment} -n --open cloud deploy:monitor -nEnvironment variables:
cloud environment:variables -n --force. To copy keys from the local.envand deploy in one step:cloud deploy {app_name} {environment} -n --push-env-keys=KEY_ONE,KEY_TWOSecrets:
echo "$VALUE" | cloud secret:create --name=NAME --json -n, thencloud environment-secret:attachProvision infrastructure:
cloud <resource>:create --json -nMonorepo (application in a subdirectory): add
--root-directory=<subdir>tocloud shiporcloud application:create.Custom domain:
cloud domain:create --json -n, thencloud domain:verify -n.Edge cache:
cloud environment:purge-edge-cache {environment} -npurges everything; pass one of--path=/blog/post,--prefix=/blog/, or--tag=<cache-tag>to purge less. Tags need a dedicated edge network.Laravel Cloud domain:
cloud environment:vanity-domain {environment} --name=<subdomain> --deploy -n --force. Pass only the first part of the domain. The new domain takes effect on the next deploy, which--deploystarts and monitors. It can change only once every 30 minutes, so confirm with the user first.Repository defaults:
cloud repo:config {application} -nsets repository-local application and organization defaults. Pass--organization=<id|name|slug>when the user has multiple organizations.
For multi-step operations, see reference/checklists.md.
If the user's needs are unclear, ask before running anything.
When a Command Fails
Read the error output.
Check the resource status with
:list --json -nor:get --json -n.For authentication errors, run
cloud auth -n.Fix the issue and rerun the command.
If the same error occurs after one fix, stop and ask the user rather than repeating the operation.
Always run cloud deploy:monitor -n after every deploy. If it fails, run cloud deployment:logs {deploymentId} --json -n to find the build or deploy step with "status": "failed" and read its output. Show the user what went wrong before attempting a fix.
Subagent Delegation
Delegate high-output operations to subagents using the Task tool to keep the main context window small. Only the summary returns; verbose output stays in the subagent's context.
Delegate these to a subagent:
cloud deploy:monitor -n— deployment logs can be very longcloud deployment:get --json -n— full deployment detailscloud deployment:logs --json -n— every step's full build or deploy outputcloud <resource>:list --json -n— listing many resources produces large JSONcloud <resource>:metrics --json -n— every data point is included; narrow it with--fields(e.g.--fields=period,cpuUsage.average)cloud command:run— when output may be longcloud usage --detailed --json -n— the payload includes details for every database, cache, bucket, websocket, and applicationFetching docs from https://cloud.laravel.com/docs/llms.txt via
WebFetch
Keep in the main context:
Short commands like
:create,:delete,:update— output is smallcloud deploy -n— you need the deployment ID immediatelyAny command where you need the result for the next step right away
Rules
Follow these rules:
Flag selection — always use the documented combos above
Deploy sequence — deploy then monitor, never skip monitoring
Destructive commands — always confirm with the user first, show the command and wait for approval. This includes deleting applications, environments, databases, caches, buckets, domains, or secrets, and detaching Resend.
Error loop — diagnose, fix once, ask user if it fails again
Use judgment for:
Instance sizes, regions, cluster types — ask the user if not specified
Which resources to provision — based on what the user describes
Order of provisioning — no strict sequence required
How to present output — summarize, show raw, or extract fields based on context
Secrets
Secrets are encrypted values shared across the organization and attached to environments. The CLI encrypts values locally, so plaintext never reaches the API.
cloud secret:list --json -n
echo "$VALUE" | cloud secret:create --name=STRIPE_KEY --json -n
cloud environment-secret:attach {environment} {secretId} -n
cloud environment-secret:detach {environment} {secretId} --force -n
cloud environment-secret:list {environment} --json -nPipe the value in. --value= works, but leaves the plaintext in shell history and the process list.
secret:update, secret:delete, environment-secret:attach, and environment-secret:detach take secret IDs, not names — names are not unique. Read IDs from cloud secret:list --json -n.
There is no secret:get. environment-secret:detach removes a secret from one environment and keeps it; secret:delete deletes it and detaches it everywhere.
Secrets need the sodium PHP extension. No other command does.
Redeploy affected environments after creating, updating, attaching, detaching, or deleting a secret.
Email (Resend)
Resend sends an environment's email. Connecting a Resend account and verifying sending domains happen in the dashboard; the CLI cannot do either. When resend:attach reports no verified sending domains, give the user the integration settings link from the error.
cloud resend:domains --status=verified --json -n
cloud resend:attach {environment} --from-address=hello@{verifiedDomain} --from-name="My App" --json -n
cloud resend:update {environment} --from-address=team@{verifiedDomain} --json -n
cloud resend:keys {environment} --json -n
cloud resend:detach {environment} --force -nThe sender address must use a verified sending domain.
--from-namedefaults to the application name.resend:attachcreates a new sending key. To share one with another environment, pass--reuse-key-idwith an ID fromresend:keys.Attaching makes Cloud set
RESEND_API_KEY,MAIL_MAILER,MAIL_FROM_ADDRESS, andMAIL_FROM_NAME, replacing any the environment already had.The application needs
resend/resend-php. Under-n,resend:attachonly warns when it is missing; runcomposer require resend/resend-phpin the project.Detaching deletes the sending key unless another environment uses it.
Redeploy the environment after attaching, updating, or detaching Resend.
Remote Access
Tinker (v0.2.0 or later)
Run PHP code directly in a Cloud environment:
cloud tinker {environment} --code='Your PHP code here' --timeout=60 -n--code— PHP code to execute (required in non-interactive mode)--timeout— maximum number of seconds to wait for output (default: 60)
The code must explicitly output results using echo, dump, or similar; expressions alone produce no output.
Always pass --code and -n to avoid interactive prompts.
Remote Commands
Run shell commands on a Cloud environment:
cloud command:run {environment} --cmd='your command here' -n--cmd— the command to run (required in non-interactive mode)--no-monitor— skip real-time output streaming--copy-output— copy output to clipboard
Review past commands:
cloud command:list {environment} --json -n— list command historycloud command:get {commandId} --json -n— get details and output of a specific command
Billing and Usage
View billing and usage for the current organization:
cloud usage --json -n--period=current|previous|1|2|3— Billing period (default:current;1,2, and3are one, two, and three periods back, respectively). Other values return an error.--environment=<id>— filter usage to a single environment--detailed— include per-application, per-resource, and per-add-on breakdowns--json— machine-readable output (always pair with-n)
Common queries:
Current spend:
cloud usage --json -n | jq '.currentSpendCents'Last month's bill:
cloud usage --period=previous --json -nOne environment, full breakdown:
cloud usage --environment=<id> --detailed --json -n
All amounts are in cents. Keys are camelCase at every level (e.g., currentSpendCents, bandwidth.allowanceBytes, databases[].totalCents, applications[].totalCostCents).
Config
Environment:
LARAVEL_CLOUD_TOKEN— an API token, taking precedence over any saved one (empty counts as unset)Global:
~/.config/cloud/config.json— auth tokens and preferencesRepo-local:
.cloud/config.json— app and environment defaults (set bycloud repo:config {application} -n)CLI arguments override both config files
Pass the application to repo:config. Without it, the command must prompt and fails under -n when the organization has more than one application. Deploy commands do not need these defaults; pass the application and environment to them directly.
Using multiple organizations requires multiple stored API tokens. Commands read organization_id from .cloud/config.json to select one and fail if it is not set. Set it with cloud repo:config {application} --organization=<id|name|slug> -n.
LARAVEL_CLOUD_TOKEN holds one token, so it picks the organization on its own. Naming a different one with --organization fails rather than falling back to the token's organization.
Documentation
Laravel Cloud documentation: https://cloud.laravel.com/docs/llms.txt
When the user asks how something works or needs an explanation of a Laravel Cloud feature, fetch the docs from the URL above using WebFetch and use it to provide accurate answers.
When Stuck
Fetch https://cloud.laravel.com/docs/llms.txt for official documentation
Run
cloud <command> -hfor any command's optionsRun
cloud -hto discover commands
Verification
Confirm the target application and environment before changing or deploying anything.
Check staged environment changes and required resources before deployment.
Monitor every deployment to completion with
cloud deploy:monitor -n.For production changes, verify the application URL, logs, queues, scheduled tasks, and relevant resource health.
Files
- ATTRIBUTION.mdAdded by AutoGineer920 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md17.6 KiB
- reference/checklists.md2.2 KiB
SKILL.md
Deploying with Laravel Cloud
Use the Laravel Cloud documentation for detailed, current feature behavior. Use the Cloud CLI for Cloud operations rather than guessing dashboard or API workflows. Install it in the project and invoke it as ./vendor/bin/cloud by default; use a globally installed cloud command only as a fallback. Commands below are written as cloud for brevity; run them as ./vendor/bin/cloud unless falling back to the global installation.
Application Setup
Laravel Cloud deploys from GitHub, GitLab, or Bitbucket. A new Laravel application requires PHP 8.2 or later, Laravel 9 or later, a connected Git provider, and a deployment region.
Cloud creates environments for applications. Use separate production, staging, and preview environments; each environment has its own compute, resources, and deployment settings.
Keep application compute and attached resources in the same region where possible.
Cloud builds a Docker image using the selected PHP version, runs the configured build and deploy commands, and switches traffic to a successful deployment with zero downtime. Push-to-deploy is enabled by default, and manual deployments and deploy hooks are also available.
Build and Deploy
A typical Laravel build command is
composer install --no-dev && npm run build.Run optimization and cache-building commands during the build, not during deployment. A typical deploy command is
php artisan migrate --force.Build and deploy commands have a 15-minute timeout. Deploy commands run immediately before the release becomes live, and filesystem changes made by deploy commands are not persisted.
Do not add
php artisan queue:restart,php artisan horizon:terminate,php artisan optimize:clear, orphp artisan storage:linkto deploy commands. Cloud handles worker restarts and process management; deploy filesystem changes are not persistent.After changing environment settings, attached resources, or linked secrets, redeploy the environment for the changes to take effect.
Configuration and Resources
Attached databases, caches, and object storage inject their connection variables automatically. Custom environment variables take precedence over injected values.
Use Secrets Manager for encrypted organization-level values shared across environments. Secret values cannot be read after creation; redeploy affected environments after creating, updating, linking, unlinking, or deleting a secret.
Environment filesystems are ephemeral and are not shared between replicas. Use a database or Laravel Valkey for persistent cache and sessions, and Laravel Cloud Object Storage for persistent files. Do not rely on local files surviving a deployment.
Object Storage and File Visibility
Laravel Cloud Object Storage is backed by Cloudflare R2. R2 applies visibility at the bucket level; a bucket cannot contain a mix of private and public objects.
For private files, always use
Storage::disk()with no arguments, such asStorage::disk()->put(...), so Laravel uses the environment's default disk. Do not pass a disk name for private/default storage. Attach a private Cloud bucket as the environment's default disk.For public files, use the named public disk:
Storage::disk('public')->put(...). Attach a second Cloud bucket configured as public and give it thepublicdisk name.Applications that use both private and public files therefore need two Cloud Object Storage buckets attached to the environment: a private default bucket and a public bucket named
public.Do not set per-file or Flysystem
visibility: 'public'configuration for Cloud Object Storage. R2 does not support per-object ACL headers and rejects those requests; select the bucket visibility when creating the bucket.Private buckets are not internet-accessible, but Laravel can generate temporary public URLs with
Storage::temporaryUrl(...). Public buckets expose all objects through their Cloud-provided public URL.Install the S3 Flysystem adapter before using Cloud Object Storage:
composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies.
Queues and Scheduling
Managed queues are the recommended queue option. They provision dedicated workers and autoscale based on queued work.
Managed queues require a supported recent Laravel version and
aws/aws-sdk-php; check the current Cloud documentation before changing dependencies.Enable the scheduler on an App or Worker cluster to run
php artisan schedule:runevery minute. When an environment has multiple replicas, use Laravel'sonOneServerfor tasks that must run once.Only Flex compute sizes can scale to zero. Scale-to-zero environments wake for Laravel scheduled tasks and queued jobs, but long-running jobs may be interrupted when the sleep timeout is reached. Use managed queues for workloads that must not be interrupted.
Domains and Storage
Each environment receives a
laravel.clouddomain after its first successful deployment. Cloud automatically verifies custom domains and provisions SSL after the required DNS records are configured.Do not use the ephemeral filesystem for persistent uploads, generated files, cache, or session data. Use the appropriate Cloud resource instead.
Cloud CLI
Setup
composer require --dev laravel/cloud-cli
./vendor/bin/cloud auth -nIf a project-local installation is not available, install the CLI globally with composer global require laravel/cloud-cli and invoke it as cloud.
cloud auth opens a browser. If a browser is unavailable, set LARAVEL_CLOUD_TOKEN in the environment. It overrides any saved token and writes nothing to disk. To save a token instead, run cloud auth:token --add --token=<token> -n or pipe it with echo "$TOKEN" | cloud auth:token --add -n.
Commands
Commands follow a CRUD pattern: resource:list, resource:get, resource:create, resource:update, resource:delete.
Available resources: application, environment, instance, database-cluster, database, cache, bucket, domain, websocket-cluster, background-process, scheduled-command, secret, command, deployment.
Some resources have additional commands (e.g., domain:verify, database:open, instance:sizes, cache:types, database:types, <resource>:metrics). Discover these via cloud -h.
Never hardcode command signatures. Always run cloud <command> -h to discover options at runtime.
CLI Flags
Always add
-nto every command to prevent the CLI from hanging.Never use
-qor--silent; they suppress all output.
Flag combos per operation:
Read (
:list,:get) →--json -nCreate (
:create) →--json -nUpdate (
:update) →--json -n --forceDelete (
:delete) →-n --force(no--json)Environment variables →
-n --forceDeploy or ship →
-nwith all options passed explicitly (no--json)
Deployment Workflow
Determine the task and follow the matching path:
First deployment: inspect
cloud ship -h, then runcloud ship -nwith all required values.Existing application:
cloud deploy {app_name} {environment} -n --open cloud deploy:monitor -nEnvironment variables:
cloud environment:variables -n --force. To copy keys from the local.envand deploy in one step:cloud deploy {app_name} {environment} -n --push-env-keys=KEY_ONE,KEY_TWOSecrets:
echo "$VALUE" | cloud secret:create --name=NAME --json -n, thencloud environment-secret:attachProvision infrastructure:
cloud <resource>:create --json -nMonorepo (application in a subdirectory): add
--root-directory=<subdir>tocloud shiporcloud application:create.Custom domain:
cloud domain:create --json -n, thencloud domain:verify -n.Edge cache:
cloud environment:purge-edge-cache {environment} -npurges everything; pass one of--path=/blog/post,--prefix=/blog/, or--tag=<cache-tag>to purge less. Tags need a dedicated edge network.Laravel Cloud domain:
cloud environment:vanity-domain {environment} --name=<subdomain> --deploy -n --force. Pass only the first part of the domain. The new domain takes effect on the next deploy, which--deploystarts and monitors. It can change only once every 30 minutes, so confirm with the user first.Repository defaults:
cloud repo:config {application} -nsets repository-local application and organization defaults. Pass--organization=<id|name|slug>when the user has multiple organizations.
For multi-step operations, see reference/checklists.md.
If the user's needs are unclear, ask before running anything.
When a Command Fails
Read the error output.
Check the resource status with
:list --json -nor:get --json -n.For authentication errors, run
cloud auth -n.Fix the issue and rerun the command.
If the same error occurs after one fix, stop and ask the user rather than repeating the operation.
Always run cloud deploy:monitor -n after every deploy. If it fails, run cloud deployment:logs {deploymentId} --json -n to find the build or deploy step with "status": "failed" and read its output. Show the user what went wrong before attempting a fix.
Subagent Delegation
Delegate high-output operations to subagents using the Task tool to keep the main context window small. Only the summary returns; verbose output stays in the subagent's context.
Delegate these to a subagent:
cloud deploy:monitor -n— deployment logs can be very longcloud deployment:get --json -n— full deployment detailscloud deployment:logs --json -n— every step's full build or deploy outputcloud <resource>:list --json -n— listing many resources produces large JSONcloud <resource>:metrics --json -n— every data point is included; narrow it with--fields(e.g.--fields=period,cpuUsage.average)cloud command:run— when output may be longcloud usage --detailed --json -n— the payload includes details for every database, cache, bucket, websocket, and applicationFetching docs from https://cloud.laravel.com/docs/llms.txt via
WebFetch
Keep in the main context:
Short commands like
:create,:delete,:update— output is smallcloud deploy -n— you need the deployment ID immediatelyAny command where you need the result for the next step right away
Rules
Follow these rules:
Flag selection — always use the documented combos above
Deploy sequence — deploy then monitor, never skip monitoring
Destructive commands — always confirm with the user first, show the command and wait for approval. This includes deleting applications, environments, databases, caches, buckets, domains, or secrets, and detaching Resend.
Error loop — diagnose, fix once, ask user if it fails again
Use judgment for:
Instance sizes, regions, cluster types — ask the user if not specified
Which resources to provision — based on what the user describes
Order of provisioning — no strict sequence required
How to present output — summarize, show raw, or extract fields based on context
Secrets
Secrets are encrypted values shared across the organization and attached to environments. The CLI encrypts values locally, so plaintext never reaches the API.
cloud secret:list --json -n
echo "$VALUE" | cloud secret:create --name=STRIPE_KEY --json -n
cloud environment-secret:attach {environment} {secretId} -n
cloud environment-secret:detach {environment} {secretId} --force -n
cloud environment-secret:list {environment} --json -nPipe the value in. --value= works, but leaves the plaintext in shell history and the process list.
secret:update, secret:delete, environment-secret:attach, and environment-secret:detach take secret IDs, not names — names are not unique. Read IDs from cloud secret:list --json -n.
There is no secret:get. environment-secret:detach removes a secret from one environment and keeps it; secret:delete deletes it and detaches it everywhere.
Secrets need the sodium PHP extension. No other command does.
Redeploy affected environments after creating, updating, attaching, detaching, or deleting a secret.
Email (Resend)
Resend sends an environment's email. Connecting a Resend account and verifying sending domains happen in the dashboard; the CLI cannot do either. When resend:attach reports no verified sending domains, give the user the integration settings link from the error.
cloud resend:domains --status=verified --json -n
cloud resend:attach {environment} --from-address=hello@{verifiedDomain} --from-name="My App" --json -n
cloud resend:update {environment} --from-address=team@{verifiedDomain} --json -n
cloud resend:keys {environment} --json -n
cloud resend:detach {environment} --force -nThe sender address must use a verified sending domain.
--from-namedefaults to the application name.resend:attachcreates a new sending key. To share one with another environment, pass--reuse-key-idwith an ID fromresend:keys.Attaching makes Cloud set
RESEND_API_KEY,MAIL_MAILER,MAIL_FROM_ADDRESS, andMAIL_FROM_NAME, replacing any the environment already had.The application needs
resend/resend-php. Under-n,resend:attachonly warns when it is missing; runcomposer require resend/resend-phpin the project.Detaching deletes the sending key unless another environment uses it.
Redeploy the environment after attaching, updating, or detaching Resend.
Remote Access
Tinker (v0.2.0 or later)
Run PHP code directly in a Cloud environment:
cloud tinker {environment} --code='Your PHP code here' --timeout=60 -n--code— PHP code to execute (required in non-interactive mode)--timeout— maximum number of seconds to wait for output (default: 60)
The code must explicitly output results using echo, dump, or similar; expressions alone produce no output.
Always pass --code and -n to avoid interactive prompts.
Remote Commands
Run shell commands on a Cloud environment:
cloud command:run {environment} --cmd='your command here' -n--cmd— the command to run (required in non-interactive mode)--no-monitor— skip real-time output streaming--copy-output— copy output to clipboard
Review past commands:
cloud command:list {environment} --json -n— list command historycloud command:get {commandId} --json -n— get details and output of a specific command
Billing and Usage
View billing and usage for the current organization:
cloud usage --json -n--period=current|previous|1|2|3— Billing period (default:current;1,2, and3are one, two, and three periods back, respectively). Other values return an error.--environment=<id>— filter usage to a single environment--detailed— include per-application, per-resource, and per-add-on breakdowns--json— machine-readable output (always pair with-n)
Common queries:
Current spend:
cloud usage --json -n | jq '.currentSpendCents'Last month's bill:
cloud usage --period=previous --json -nOne environment, full breakdown:
cloud usage --environment=<id> --detailed --json -n
All amounts are in cents. Keys are camelCase at every level (e.g., currentSpendCents, bandwidth.allowanceBytes, databases[].totalCents, applications[].totalCostCents).
Config
Environment:
LARAVEL_CLOUD_TOKEN— an API token, taking precedence over any saved one (empty counts as unset)Global:
~/.config/cloud/config.json— auth tokens and preferencesRepo-local:
.cloud/config.json— app and environment defaults (set bycloud repo:config {application} -n)CLI arguments override both config files
Pass the application to repo:config. Without it, the command must prompt and fails under -n when the organization has more than one application. Deploy commands do not need these defaults; pass the application and environment to them directly.
Using multiple organizations requires multiple stored API tokens. Commands read organization_id from .cloud/config.json to select one and fail if it is not set. Set it with cloud repo:config {application} --organization=<id|name|slug> -n.
LARAVEL_CLOUD_TOKEN holds one token, so it picks the organization on its own. Naming a different one with --organization fails rather than falling back to the token's organization.
Documentation
Laravel Cloud documentation: https://cloud.laravel.com/docs/llms.txt
When the user asks how something works or needs an explanation of a Laravel Cloud feature, fetch the docs from the URL above using WebFetch and use it to provide accurate answers.
When Stuck
Fetch https://cloud.laravel.com/docs/llms.txt for official documentation
Run
cloud <command> -hfor any command's optionsRun
cloud -hto discover commands
Verification
Confirm the target application and environment before changing or deploying anything.
Check staged environment changes and required resources before deployment.
Monitor every deployment to completion with
cloud deploy:monitor -n.For production changes, verify the application URL, logs, queues, scheduled tasks, and relevant resource health.
Requirements and compatibility
Written for: Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Names Claude Code tools, Needs an API key, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- laravel
- Publisher
- Laravel (Official)
- Source
- laravel/boost · .ai/deployments/skill/deploying-to-cloud · commit 5f8d05d
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by laravel.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download deploying-to-cloud.zip