# Host client portal with Laravel: application activity history

Deploy a client portal built with Laravel on Ample using the transactional workflows pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on Laravel: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Not separately tested: your domain records, validation rules and concurrency policy; treat the client portal-specific behavior as your application code.

## Representative Queries
- Host client portal with Laravel: application activity history
- Where can I host Client portal built with Laravel?
- I need an application-owned event schema and tested history queries; not native platform audit logs.

## Resource Requirements
- `primitive:compute`
- `primitive:postgres`

## Infrastructure Requirements
### Compute
- **Status:** verified  
- **Summary:** Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.

### Postgres
- **Status:** verified  
- **Summary:** Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.

## Prerequisites
- A Laravel project that builds and starts with the documented commands.  
- A PostgreSQL driver reading DATABASE_URL at runtime.  
- An Ample account token with the necessary permissions.

## Workflow Steps
### 1. Build and Start
- **Body:** `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. Implement the pattern on PostgreSQL
- **Body:** The fixture's module implements transactional workflows: Keep migrations idempotent and run them with --release-command.

### 3. Deploy
- **Command:** `ample deploy . --name  --public`

### 4. Verify
- **Command:** `ample logs  --kind build`

## Limitations
- Verified on the php-8.5 template at s-1vcpu-1gb; other sizes & versions not verified.  
- The client portal itself is application code and was not separately tested;

## Cost Estimate
- **Currency:** USD  
- **Monthly Amount:** 10.0  
- **Components:**  
  - app server: size s-1vcpu-1gb - $5.0  
  - managed PostgreSQL database: size s-1vcpu-1gb - $5.0

## Next Actions
- **Browse the catalog index**  
- **Search published recipes by intent, stack and constraints**  
- **Prepare a side-effect-free deployment plan for an authorized project**  
- **Read the existing agent authentication setup**  
- **Browse Client portal**  
- **Browse Laravel**  
- **Browse Transactional workflows**  
- **Browse Deploy web app**

## Evidence Summary
- **Canary run**: Laravel pattern fixture deployed on Ample.  
- Another canary run showed the same Laravel app deployed with a migration.
