Code & Teknis
Dibuat oleh Susi Saputra Creator
Tentang koleksi ini
Code review, debug, refactor, dan dokumentasi teknis.
Prompt dalam koleksi ini
Dokumentasi API Endpoint
Buat dokumentasi API endpoint: Endpoint: [METHOD /path] Deskripsi: [apa fungsinya] Request body sample: [paste] Response sample: [paste] Auth require...
Buat dokumentasi API endpoint:
Endpoint: [METHOD /path]
Deskripsi: [apa fungsinya]
Request body sample: [paste]
Response sample: [paste]
Auth required: [ya/tidak + tipe]
Format dokumentasi:
## [End...
Buat dokumentasi API endpoint: Endpoint: [METHOD /path] Deskripsi: [apa fungsinya] Request body sample: [paste] Response sample: [paste] Auth required: [ya/tidak + tipe] Format dokumentasi: ## [Endpoint name] **Endpoint:** `METHOD /path` **Auth:** [auth requirement] **Rate limit:** [kalau ada] ### Description [1 paragraf jelaskan fungsi + use case] ### Request **Headers:** [tabel header yang required] **Body:** [tabel: field, type, required, description, example] ### Response **Success (200/201):** [paste JSON + jelaskan tiap field] **Errors:** [tabel: status code, scenario, response] ### Example [cURL command lengkap] [Sample response] ### Notes [edge cases, caveats, related endpoints]
Eloquent Query Optimization
Optimasi Eloquent query Laravel berikut: Query saat ini: [paste] Konteks: [page/feature apa] Volume data: [estimasi rows] Loading time saat ini: [ber...
Optimasi Eloquent query Laravel berikut:
Query saat ini: [paste]
Konteks: [page/feature apa]
Volume data: [estimasi rows]
Loading time saat ini: [berapa detik]
DB engine: [MySQL/PostgreSQL/SQLite]
A...
Optimasi Eloquent query Laravel berikut: Query saat ini: [paste] Konteks: [page/feature apa] Volume data: [estimasi rows] Loading time saat ini: [berapa detik] DB engine: [MySQL/PostgreSQL/SQLite] Analisis: 1. Identify performance issue (N+1, missing index, etc) 2. Explain dampaknya pada query Optimasi: 1. Refactored query dengan eager loading 2. Index suggestion (kolom + alasan) 3. Cache strategy (kalau applicable) 4. Pagination/chunking jika data besar 5. Database-level optimization (kalau query complex) Kasih before vs after benchmark estimasi. Gunakan Laravel features (with, withCount, withCache, scopes).
Debug Error PHP / Laravel
Bantu debug error berikut: Framework/version: [Laravel X / PHP X.X] Error message lengkap: [paste] Kode yang trigger error: [paste] Apa yang sudah di...
Bantu debug error berikut:
Framework/version: [Laravel X / PHP X.X]
Error message lengkap: [paste]
Kode yang trigger error: [paste]
Apa yang sudah dicoba: [list]
Konteks: [feature/page apa]
Proses d...
Bantu debug error berikut: Framework/version: [Laravel X / PHP X.X] Error message lengkap: [paste] Kode yang trigger error: [paste] Apa yang sudah dicoba: [list] Konteks: [feature/page apa] Proses debug: 1. Diagnosa root cause (bukan symptom) 2. Jelaskan kenapa error terjadi (logic-wise) 3. Kasih 2-3 cara memperbaiki dengan trade-off masing-masing 4. Rekomendasi mana yang terbaik + alasan 5. Code snippet perbaikan lengkap 6. Cara verify perbaikan work 7. Saran untuk mencegah error serupa di masa depan Kalau perlu info tambahan, sebutkan dengan spesifik apa yang dibutuhkan.
Code Review Checklist Laravel
Review kode Laravel berikut: Kode: [paste kode] Konteks: [feature apa] Check dengan kriteria: ✅ Functionality - Logic correct? - Edge cases handl...
Review kode Laravel berikut:
Kode: [paste kode]
Konteks: [feature apa]
Check dengan kriteria:
✅ Functionality
- Logic correct?
- Edge cases handled?
- Error handling lengkap?
✅ Laravel Best Practi...
Review kode Laravel berikut: Kode: [paste kode] Konteks: [feature apa] Check dengan kriteria: ✅ Functionality - Logic correct? - Edge cases handled? - Error handling lengkap? ✅ Laravel Best Practices - Eloquent N+1 problem? - DB query efficient? - Caching dimanfaatkan? - Validation di Form Request? ✅ Security - SQL injection risk? - XSS risk? - Authorization check? - Mass assignment safe? ✅ Code Quality - Method panjang? (>20 lines pertimbangkan extract) - Naming clear? - Dependencies injection benar? - Single Responsibility? Kasih saran perbaikan konkret, dengan contoh code refactor di setiap saran.
Masuk
untuk menyimpan prompt ke koleksi kamu.