Skip to content
prod e051e98
Browse

Gotchas

Resources · cheat sheet

The traps that cost hours the first time. Scan the table, apply the fix. Each row links to the playbook page that explains it.

GotchaWhat goes wrongThe fix
APP_DEBUG=true off localStack traces and the full env leak to visitors in productionAPP_DEBUG=false on staging and production; APP_ENV=production. Only local gets APP_DEBUG=true.
Shared APP_KEY across environmentsOne leaked key compromises every encrypted value and signed cookie everywhereGenerate a unique APP_KEY per environment. Leave it blank in templates; php artisan key:generate fills local, the first deploy generates it on the server.
Regenerating a set APP_KEYRe-running key:generate invalidates all existing encrypted data and sessionsRun key:generate only if APP_KEY is empty. Never re-key a live environment.
3-byte utf8 databaseCodeCanyon apps storing emoji / multi-byte content throw collation errorsCreate the schema as utf8mb4 / utf8mb4_unicode_ci from the start.
composer install over a customized vendor/It restores vanilla vendor files and silently wipes your overlay editsRun the restore script after every composer install, deploy, or vendor update — before you trust the app.
Destructive migration with no backupDROP COLUMN / DROP TABLE / TRUNCATE destroys customer data on deployClear the Atlas gate first — STOP on DS102/DS103. Back up + get approval + prove on staging. TRUNCATE = manual approval only.
Secrets in a server sync.env, *.key, *.pem, or credentials get committed into gitScreen git status before staging; never commit secrets. If one was pushed: revert immediately and rotate the credential.
Cloudflare SSL = FlexibleRedirect loops and an insecure edge↔origin hop behind CloudflareSet SSL mode to Full (Strict) + enable Always Use HTTPS.
Cloudflare Rocket Loader ONDefers/reorders JS — breaks CSRF injection, Livewire/Alpine/Vite scriptsLeave Rocket Loader OFF for Laravel.
Editing a vendor migrationThe next vendor update overwrites your changeNever touch it — add columns via an additive _zaj migration (add_{cols}_to_{table}_zaj.php) with a ZAJ: comment; the Atlas diff catches a clash — see the customization decision.

Per-environment values that must differ — never copy one environment’s .env to another:

Keylocalstagingproduction
APP_ENVlocalstagingproduction
APP_DEBUGtruefalsefalse
APP_KEYunique (key:generate)unique (per env)unique (per env)

Plus: double-quote every secret value, ship .env.example with fail-loud placeholders (blank or obviously fake) so a missing value crashes immediately instead of booting against the wrong database, and never stage a real .env.

Any time vendor/ is rewritten — a fresh composer install, a deploy, or a vendor update — your resources/vendor-customizations/ overlay is gone until the restore script re-applies it.

Terminal window
composer install
php Admin-Local/.../restore-vendor-customizations.php
# Expected: a per-package "Restored N file(s)" summary