iLeben treats Salesforce as the single source of truth for commercial and operational entities. Projects (Proyectos), plants (Plantas), advisors (Asesores), branding assets, contact channels, and broker metrics all flow from Salesforce into the local MySQL database on a schedule. In the opposite direction, every public contact form submission is pushed to Salesforce as a Lead — with automatic retry logic so no lead is silently dropped. The integration is built on theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/scooller/Leben-site/llms.txt
Use this file to discover all available pages before exploring further.
omniphx/forrest library and uses the WebServer OAuth flow for persistent, user-authorized API access.
What Syncs From Salesforce
The following entities are owned by Salesforce and periodically pulled into iLeben’s local database:Proyectos
Real estate projects with stage normalization (
etapa), commercial fields, discount thresholds, and advisor assignments.Plantas
Individual units (Product2) with pricing, surfaces, orientation, floor, and interior image URLs.
Asesores
Salesforce Users mapped to local advisors with avatar URL, WhatsApp, and activity status.
Branding & Images
Public Documents (cotizador logo / portada) resolved via
SF_PUBLIC_SITE_URL and SF_ORG_ID.Contact Channels
ContactChannel records synced from Salesforce — displayed as color-coded badges in the Filament panel.Broker Metrics
Commercial metrics recalculated from local opportunity snapshots via
salesforce:sync-broker-metrics.What Syncs To Salesforce
Contact form submissions submitted viaPOST /api/v1/contact-submissions are enqueued as CreateSalesforceCaseJob and sent to Salesforce as Leads. The job includes automatic retry on invalid field errors, UTM enrichment, and full OAuth reconnect logic.
Whether the integration sends a Lead, a Case, or both is controlled by
SF_LEAD_ENABLED and SF_CASE_ENABLED. See Leads & Contacts for details.Architecture Overview
The core service class isApp\Services\Salesforce\SalesforceService, which wraps all SOQL queries with Cache::remember using a configurable TTL (default 15 minutes). Mutations (Lead and Case creation) are handled through Forrest::sobjects() with a multi-attempt retry chain.
Key Environment Variables
Configure the Salesforce integration in your.env file using these variables:
| Variable | Purpose | Example |
|---|---|---|
SF_AUTH_METHOD | OAuth flow type — use WebServer | WebServer |
SF_CONSUMER_KEY | Connected App consumer key | 3MVG9... |
SF_CONSUMER_SECRET | Connected App consumer secret | ABC123... |
SF_CALLBACK_URI | OAuth redirect URI registered in Salesforce | https://app.example.com/salesforce/callback |
SF_LOGIN_URL | Salesforce login endpoint | https://login.salesforce.com |
SF_API_VERSION | Salesforce API version | 57.0 |
SF_INSTANCE_URL | Your Salesforce org instance URL | https://your-domain.my.salesforce.com |
SF_LEAD_ENABLED | Enable Lead creation from contact forms | true |
SF_CASE_ENABLED | Enable Case creation from contact forms | true |
SF_OAUTH_SCOPE, SF_OAUTH_PROMPT, SF_LEAD_OWNER_ID, etc.) are covered in the specific integration pages below.
Related Pages
OAuth Setup
Configure the WebServer OAuth flow, connected app scopes, and the auto-reconnect backup mechanism.
Sync Commands
Artisan commands, scheduler config, Production Sync job, and cPanel cron setup.
Leads & Contacts
How form submissions become Salesforce Leads, UTM mapping, CSV import, and activity log.