## Real estate brokerages: public directory using Laravel

### Summary
A public directory blueprint for real estate brokerages built with Laravel on Ample. Domain schema:
- **Listings** (reference, address, price, listing_type, publishing_status, agency_id): property listings with publishing status;
- **Agencies** (name, license_number, region): agencies or branches;
- **Listing Media** (listing_id, object_key, cdn_key, sort_order): public media per listing;
- **Reports** (agency_id, period, object_key, generated_at): agency-scoped reports;
- **State Transitions** (record_type, from_state, to_state): the allowed state machine.

Public information includes published listings with media, agent and agency profiles, buying and selling guides. 
Kept out of scope until handling is reviewed: vendor and buyer identity, offers and negotiations, unpublished listings.
Only listings with `publishing_status = published` appear publicly; offers and identities are out of scope.

Technical basis verified on Laravel: a workspace-scoped table, an explicit state machine (draft to review to published) that rejects invalid transitions, and a cross-workspace read that returns nothing (transitions=true isolation=true).

### Representative Queries
- Real estate brokerages: public directory using Laravel
- Where can I host Real estate brokerages: Public directory built with Laravel?
- I need a genuinely specialized public directory workflow covering property listings, publishing status, and agency-scoped reporting.

### Framework
**Framework:** Laravel  
**Workload:** Public directory  
**Industry:** Real estate brokerages  
**Release Status:** Published  
**Support Status:** Verified  
**Execution Status:** Ready

### Resource Requirements
- **Primitive**: compute  
- **Primitive**: postgres  
- **Primitive**: cdn

### Infrastructure Requirements
- **Compute**: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
- **Postgres**: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.
- **CDN**: The CDN host serves objects from published buckets. It does not front app compute and is not a cache or key-value store.

### 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)  
- A PostgreSQL driver reading DATABASE_URL (auto-provisioned when omitted)  
- Bucket credentials from `ample bucket create` passed as encrypted S3_* environment variables and a published bucket for public assets (CDN_*)  
- A review of which real estate brokerages data classes may be handled at all; this blueprint models public information only

### Workflow Steps
1. **Model the real estate brokerages domain**: Create tables listings, agencies, listing_media, reports, state_transitions. Keep the sensitive classes out of this schema.
2. **Model listings** with a `publishing_status` state machine scoped to the agency.
3. **Serve only published listings**, with media from the CDN bucket.
4. **Enforce the agency scope** on every query.
5. **Deploy**: Run the synchronous deploy once and read the result.
6. **Verify**: Run the pattern self-test(s) from the example and your own acceptance checks for the real estate brokerages workflow.

### Examples
- **Title**: Laravel pattern fixture  
  **Description**: Verified relational records basis for this blueprint.  
  **Source Ref**: tests/deploy-canaries/laravel-patterns

### Success Checks
- **Description**: App responds on its public URL  
  **Kind**: http_get  
  **Path**: /  
  **Expect**: ample canary laravel patterns  
- **Description**: Relational-records self-test from the example  
  **Kind**: http_get  
  **Path**: /p/relational-records  
  **Expect**: see the pattern fixture checks

### Limitations
- The technical basis for listings with `publishing_status = published` was verified with the pattern fixture.
- Only public content and synthetic examples until actual data-handling requirements have been reviewed.

### Cost Estimate
- **Monthly Amount**: $10.00  
  **Currency**: USD  
  **Basis**: size prices from pricing.toml, including  
  - **App server**: $5.00/month  
  - **Managed PostgreSQL database**: $5.00/month

### Evidence Summary
- **Kind**: canary_run  
  **Summary**: Laravel pattern fixture deployed on Ample; the relational records checks passed.

### Next Actions
1. **Action ID**: browse-catalog  
  **Label**: Browse the catalog index  
  **Method**: GET  
2. **Action ID**: search-recipes  
  **Label**: Search published recipes by intent, stack and constraints  
  **Method**: POST  
3. **Action ID**: plan:page:blueprints:real-estate-brokerages:public-directory:laravel  
  **Label**: Prepare a side-effect-free deployment plan for an authorized project  
  **Method**: POST
