### Real estate brokerages: vendor portal using Laravel

A vendor portal 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;
- **document_access** (document_id, principal_reference, role, granted_at): who may read which document.

**Public information**: 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 role-to-document access model with negative tests (401 without identity, 403 for the wrong role) and a private-bucket round-trip for the allowed role (private=ok).

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

#### Resource Requirements
- `primitive:compute`
- `primitive:postgres`
- `primitive:s3-compatible-object-storage`

#### Infrastructure Requirements
1. **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.
2. **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.
3. **S3-compatible object storage**
   - **Status**: verified
   - **Summary**: Buckets are S3-compatible with issued credentials; PutObject and GetObject are verified by canary. Other S3 operations are not verified.

#### 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
- A review of which real estate brokerages data classes may be handled at all; this blueprint models public information only.

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

#### Workflow Steps
1. Model the real estate brokerages domain
   - Create the tables listings, agencies, listing_media, reports, document_access. Property listings with publishing status lives in listings; keep the sensitive classes (vendor and buyer identity, offers and negotiations, unpublished listings) out of this schema.
2. Model vendors scoped to the agency with roles.
3. Authorize document access by vendor and role (401, 403 negative tests).
4. Store vendor documents in the private bucket.
5. Deploy and verify the negative tests and an authorized download.
6. Run the synchronous deploy once and read the result. Re-running with no change is a no-op. 
   ```
   ample deploy . --name  --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=...
   ```
7. Run the pattern self-test(s) from the example (/p/private-document-library) and your own acceptance checks for the real estate brokerages workflow.

#### Success Checks
- App responds on its public URL
- Private-document-library self-test from the example

#### Limitations
- The technical basis (private document library on Laravel) was verified with the pattern fixture; the real estate brokerages schema and workflow are an original design for this blueprint and were not executed as a separate application. 
- Public content and synthetic examples only until actual data-handling requirements have been reviewed.

### Cost Estimate
- **Currency**: USD
- **Monthly Amount**: $10.00
- **Basis**: size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty 
- **Components**:
  - App server: size s-1vcpu-1gb, quantity 1.0, monthly amount $5.00
  - Managed PostgreSQL database: size s-1vcpu-1gb, quantity 1.0, monthly amount $5.00

### Evidence Summary
- *Canary run*: Laravel pattern fixture deployed on Ample; the private document library checks passed: a role-to-document access model with negative tests (401 without identity, 403 for the wrong role) and a private-bucket round-trip for the allowed role (private=ok).

### Format Links
- [HTML Format](/content/blueprints/real-estate-brokerages/vendor-portal/laravel/index.html)
- [Markdown Format](/content/blueprints/real-estate-brokerages/vendor-portal/laravel.md)
- [JSON Format](https://api.ample.computer/v1/catalog/recipes/page%3Ablueprints%3Areal-estate-brokerages%3Avendor-portal%3Alaravel)
