feat: production email (Resend) + offsite backup (B2)

Resend mail transport:
- composer require resend/resend-laravel (v1.4)
- Laravel 11 ships the 'resend' mailer config in config/mail.php + services
- To switch to production email: set MAIL_MAILER=resend + RESEND_API_KEY,
  register the domain at resend.com/domains, and add the TXT + DKIM CNAME
  records in Cloudflare. .env.example documents the required steps.

Backblaze B2 offsite backup:
- New filesystems 'b2' disk (S3-compatible, env: B2_KEY/SECRET/BUCKET/REGION/ENDPOINT)
- BackupAllTenantsCommand: after writing each tenant's zip to local disk, it
  uploads the same file to the b2 disk under {YYYY-MM-DD}/{slug}.zip — only
  when both B2_KEY and B2_BUCKET are set, so unconfigured installs are no-op
- Without offsite, backups live on the same VPS as production: a single
  hardware failure loses everything. B2 + Resend together make the install
  genuinely production-ready (people get email + offsite backup).

Tests (2 new):
- backup uploads to b2 (fake disk) when configured
- backup skips offsite when env vars not present

Full suite: 140 passed. Force-rebuild deploy required so composer install
picks up resend/resend-php.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 06:43:39 +00:00
parent 51917bcbaf
commit 439ef605a1
6 changed files with 230 additions and 2 deletions
+1
View File
@@ -16,6 +16,7 @@
"laravel/sanctum": "^4.3",
"laravel/tinker": "^2.10.1",
"minishlink/web-push": "^10.0",
"resend/resend-laravel": "^1.4",
"spatie/laravel-activitylog": "^5.0",
"spatie/laravel-medialibrary": "^11.22",
"spatie/laravel-permission": "^7.4",