Skip to main content

Documentation 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.

iLeben is deployed on cPanel shared hosting by placing the Laravel project in a subdirectory (e.g. ~/laravel) and pointing public_html at its public/ folder via a symlink. This keeps all application code outside the web root while preserving standard cPanel domain routing.

Requirements

  • PHP 8.4+ — required by Laravel 12 and iLeben’s type signatures
  • MySQL 8+ — used as the primary database
  • Node.js 18+ — required to build the React frontend
  • Composer 2.x — PHP dependency manager

Deployment Steps

1

Clone the repository

Clone the project into a directory inside your cPanel home folder. Using laravel as the directory name keeps paths predictable.
git clone <repo-url> ~/laravel
cd ~/laravel
2

Install PHP dependencies

Install backend dependencies without development packages and with an optimised autoloader for production.
composer install --no-dev --optimize-autoloader
3

Create and configure the environment file

Copy the example file and generate a unique application key.
cp .env.example .env
php artisan key:generate
Then open .env and fill in all required values. See the Environment Variables reference below.
4

Configure all environment variables

At minimum you must set DB_*, the Salesforce SF_* block, and payment gateway credentials before running migrations. See the table in the Environment Variables section for the full list of groups.
5

Run database migrations

Apply all schema migrations. The --force flag is required when APP_ENV=production because Laravel will otherwise refuse to run migrations non-interactively.
php artisan migrate --force
6

Build the React frontend

Install Node.js dependencies and produce a production build inside frontend/dist/.
cd frontend && npm install && npm run build && cd ..
7

Create the storage symlink

Expose the storage/app/public directory so uploaded files are accessible from the web.
php artisan storage:link
8

Optimise for production

Cache configuration, routes, and views so Laravel skips file parsing on every request.
php artisan optimize
9

Remove the existing public_html directory

The symlink cannot be created if a public_html directory (or symlink) already exists at the same path.
rm -rf ~/public_html
10

Create the public_html symlink

Point cPanel’s web root directly at Laravel’s public/ folder.
ln -s ~/laravel/public ~/public_html
11

Set directory permissions

Apache must be able to traverse from the home directory down to public/. Without these permissions you will see 403 Forbidden errors even with a correct .htaccess.
# Home directory: traversable by Apache
chmod 711 /home/username

# Laravel root: readable and traversable
chmod 755 /home/username/laravel

# public/ directory: same as laravel root
chmod 755 /home/username/laravel/public

# storage and cache: writable by the web server
chmod -R 775 /home/username/laravel/storage
chmod -R 775 /home/username/laravel/bootstrap/cache
Replace username with your actual cPanel account name.

Environment Variables

Configure .env by group. Every variable listed below maps to a key in .env.example.

Database

VariableDescriptionExample
DB_CONNECTIONDriver (always mysql in production)mysql
DB_HOSTMySQL host127.0.0.1
DB_PORTMySQL port3306
DB_DATABASEDatabase nameileben_ddbb
DB_USERNAMEDatabase userileben_user
DB_PASSWORDDatabase password••••••••

Salesforce

VariableDescription
SF_AUTH_METHODOAuth method — use WebServer for production
SF_CONSUMER_KEYConnected App consumer key
SF_CONSUMER_SECRETConnected App consumer secret
SF_CALLBACK_URIMust match the Connected App callback exactly
SF_LOGIN_URLhttps://login.salesforce.com
SF_INSTANCE_URLYour org’s My Domain URL
SF_API_VERSIONAPI version (e.g. 57.0)

Payments

VariableDescription
TRANSBANK_ENVIRONMENTintegration or production
TRANSBANK_COMMERCE_CODETransbank commerce code
TRANSBANK_API_KEYTransbank API key
TRANSBANK_MALL_MODEtrue to enable Transbank Mall
TRANSBANK_STORE_CODESJSON map of store codes per project
MERCADOPAGO_PUBLIC_KEYMercado Pago public key
MERCADOPAGO_ACCESS_TOKENMercado Pago access token
MERCADOPAGO_WEBHOOK_SECRETSignature secret for webhook verification

App

VariableDescription
APP_NAMEApplication name (displayed in the panel)
APP_ENVMust be production on live deployments
APP_DEBUGMust be false in production
APP_URLCanonical public URL (e.g. https://ileben.cl)
FRONTEND_URLReact frontend URL
CLOUDFLARE_TURNSTILE_SECRET_KEYServer-side key for CAPTCHA validation

Mail

VariableDescription
MAIL_MAILERDriver — smtp, sendmail, etc.
MAIL_HOSTSMTP host
MAIL_PORTSMTP port
MAIL_USERNAMESMTP username
MAIL_PASSWORDSMTP password
MAIL_FROM_ADDRESSSender address
MAIL_CC_CONTACT_SUBMISSION_ADMINAdmin CC for contact submissions

Queue

VariableDescription
QUEUE_CONNECTIONMust be database on cPanel (no Redis)
SESSION_DRIVERdatabase recommended
CACHE_STOREdatabase recommended

After Each Deploy

Run php artisan optimize:clear after every deploy to flush cached configuration, routes, and views before running php artisan optimize again. Do not run migrate:fresh on a live database — it drops all tables and destroys production data.

Troubleshooting 403 Errors

A 403 Forbidden response after creating the symlink is almost always caused by directory permissions on the cPanel home folder or the laravel/ directory — not by a missing or incorrect .htaccess. Apache must be able to traverse every directory in the path from /home/username down to public/. Verify that /home/username has at least 711 and ~/laravel has 755.

Build docs developers (and LLMs) love