laravel:config-env-storage
Storage Config (S3/R2/MinIO/CDN)
Configure storage once; switch providers via env.
Env
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_DEFAULT_REGION=auto
AWS_BUCKET=...
AWS_ENDPOINT=https://r2.example.com # for R2/MinIO
AWS_USE_PATH_STYLE_ENDPOINT=true # if required
MEDIA_CDN_URL=https://cdn.example.com # optional CDN/base URL
Tips
- Prefer pre‑signed URLs for uploads/downloads when possible
- For CDN, prefix public URLs with
MEDIA_CDN_URL(app URL generation helper) - Use path‑style only when necessary; some providers require it
Testing
- Fake storage in unit tests (
Storage::fake('s3')) - Integration tests verify URL formats and ACLs
More from jpcaparas/superpowers-laravel
laravel:blade-components-and-layouts
Compose UIs with Blade components, slots, and layouts; keep templates pure and testable
90laravel:routes-best-practices
Keep routes clean and focused on mapping requests to controllers; avoid business logic, validation, or database operations in route files
89laravel:quality-checks
Unified quality gates for Laravel projects; Pint, static analysis (PHPStan/Psalm), Insights (optional), and JS linters; Sail and non-Sail pairs provided
80laravel:performance-caching
Use framework caches and value/query caching to reduce work; add tags, locks, and explicit invalidation strategies for correctness
77laravel:eloquent-relationships
Define clear relationships and load data efficiently; prevent N+1, use constraints, counts/sums, and pivot syncing safely
76laravel:tdd-with-pest
Apply RED-GREEN-REFACTOR with Pest or PHPUnit; use factories, feature tests for HTTP, and parallel test runners; verify failures before implementation
76