# Configure environment and secrets for Laravel

Configuration and secrets for a Laravel app on Ample. Verified on Laravel: an --env value delivered encrypted and reported as present without being echoed (secret=set). Build and start: composer install --no-dev from composer.lock, then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template.

## Prerequisites
- A Laravel project (composer install --no-dev from composer.lock, then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template)
- An Ample account token with servers:write

## Workload
Configure environment and secrets

## Framework
Laravel

## Tested Configuration
- **Template:** php-8.5
- **Runtime:** php
- **Size:** s-1vcpu-1gb
- **Install:** composer install --no-dev --prefer-dist --no-interaction --no-progress --optimize-autoloader
- **Start:** frankenphp php-server --listen :$PORT --root public

## Workflow Steps
1. **Build and start**  
   composer install --no-dev from composer.lock, then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template; the server must bind 0.0.0.0 on PORT.
2. **Pass values on deploy**  
   Use --env KEY=value (repeatable) or --env-file; values are encrypted at rest and reused on redeploys. Declare names only in ample.toml.  
   **Command:** ample deploy . --name  --public --env MY_SECRET=...
3. **Verify**  
   Fetch the live URL and /p/configuration-secrets on the example; on failure read the build and runtime logs.  
   **Command:** ample logs  --kind build

## Examples
- **Laravel pattern fixture**: Verified configuration and secrets on Laravel.  
   Source Reference: tests/deploy-canaries/laravel-patterns

## Success Checks
- **App responds on its public URL**  
   **Kind:** http_get  
   **Path:** /  
   **Expect:** ample canary laravel patterns
- **Configuration-secrets check from the example**  
   **Kind:** http_get  
   **Path:** /p/configuration-secrets  
   **Expect:** see the pattern fixture checks

## Limitations
- Verified on the php-8.5 template at s-1vcpu-1gb; other sizes and Laravel major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.

## Cost Estimate
- **Currency:** USD
- **Monthly Amount:** 5.0
- **Authoritative:** true
- **Basis:** size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
- **Components:**
  - **Name:** app server
  - **Size:** s-1vcpu-1gb
  - **Quantity:** 1.0
  - **Monthly Amount:** 5.0
  
  Note: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

## Evidence Summary
- **Kind:** canary_run
- **Summary:** Laravel pattern fixture deployed on Ample (composer install --no-dev from composer.lock, then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template).
- **Observed At:** 2026-09-20T20:36:21Z
- **Implementation Revision:** 118ad1c6d7d23d4c2ce069254bab9ec9d37cd57b-dirty (CLI 118ad1c)
- **Expires At:** 2027-03-19T20:36:21Z
- **Scope:**
  - **Checks:** [/p/configuration-secrets]
  - **Template:** php-8.5

## Formats
- **HTML:** https://ample.computer/guides/laravel/configuration-secrets
- **Markdown:** https://ample.computer/guides/laravel/configuration-secrets.md
- **JSON:** https://api.ample.computer/v1/catalog/recipes/page%3Aguides%3Alaravel%3Aconfiguration-secrets

## Next Actions
- **Browse the catalog index**  
   **Action ID:** browse-catalog  
   **Method:** GET  
   **Path:** /v1/catalog
- **Search published recipes by intent, stack and constraints**  
   **Action ID:** search-recipes  
   **Method:** POST  
   **Path:** /v1/catalog/search
   **Parameters:** {"body":{"limit":5,"query":"Configure environment and secrets for Laravel"}}
- **Prepare a side-effect-free deployment plan for an authorized project**  
   **Action ID:** plan:page:guides:laravel:configuration-secrets  
   **Method:** POST  
   **Path:** /v1/catalog/plan  
   **Parameters:** {"body":{"inputs":{},"projectId":"","recipeId":"page:guides:laravel:configuration-secrets","recipeRevision":"r1"}}
- **Read the existing agent authentication setup**  
   **Action ID:** auth-setup  
   **Method:** GET  
   **Path:** /mcp/setup
- **Browse Laravel**  
   **Action ID:** browse:stack:framework-laravel  
   **Method:** GET  
   **Path:** /v1/catalog/nodes/stack%3Aframework-laravel
- **Browse Configure deployment**  
   **Action ID:** browse:intent:configure-deployment  
   **Method:** GET  
   **Path:** /v1/catalog/nodes/intent%3Aconfigure-deployment
- **Browse Public web service**  
   **Action ID:** browse:pattern:public-web-service  
   **Method:** GET  
   **Path:** /v1/catalog/nodes/pattern%3Apublic-web-service
