รายงานเปรียบเทียบการย้ายระบบ (Migration Comparison Report)#
1. ผลทดสอบ#
| รายการ | ผล |
|---|
| Total Routes ที่ทดสอบ | 110 |
| PASS (เหมือนกัน) | 96 (87%) |
| FAIL (ต่างกัน) | 14 (13%) |
2. หน้าที่ PASS ✅ (96 หน้า - ทำงานเหมือนกัน)#
ทุกหน้าต่อไปนี้ ทำงานเหมือนกัน ทั้งสองระบบ (HTTP 200):Dashboard & Home#
/sales/dashboard Sales Dashboard ✅
/admin/dashboard Admin Dashboard ✅
Series Tour#
/series-tour ✅ | /tours ✅ | /tours/create ✅ | /tours/series ✅ | /tours/settings/series ✅
Period#
/period ✅ | /period/rushtoSell/export ✅
Booking#
/my-booking ✅ | /booking/all ✅ | /bookings ✅
Payment#
/payment-due ✅ | /payment ✅
Invoice & Receipt#
/invoices/all ✅ | /invoices/request ✅ | /invoice ✅ | /invoice/list ✅ | /invoice/request/list ✅ | /invoicetax ✅ | /receipt ✅
Ticket#
/ticket/series ✅ | /ticket/pre-sale ✅ | /ticket/ticket ✅ | /tickets/chart ✅
Incentive#
/incentive ✅ | /incentive/create ✅
Event#
/event ✅ | /event/email ✅
Agency#
/agency ✅ | /agency/create ✅ | /agency/sales ✅ | /agency/sales/create ✅ | /agency/credit-shell ✅
Admin / User Management#
/admin ✅ | /admin/create ✅
Account#
/account ✅ | /account/password ✅
Settings (16/19 ผ่าน)#
/setting ✅ | Airline ✅ | Country ✅ | City ✅ | Bank ✅ | Land Operations ✅ | Route ✅
Reports (22/23 ผ่าน)#
/report/booking ✅ | /reports ✅ | Payment ✅ | Period ✅ | Income ✅ | Commission ✅
Costing (4 routes) ✅ | Estimates (2 routes) ✅ | Actual Estimates (4 routes) ✅
Invoice ✅ | Invoice Full Payment ✅ | Agency (2 routes) ✅ | Period Sales Monthly ✅ | Payment Series Summary ✅
Document#
/document ✅ | /document/series ✅
REST APIs (15/17 ผ่าน)#
Dashboard ✅ | Notifications ✅ | Payments ✅ | Series ✅ | Costing ✅ | All Booking ✅ | Income ✅ | Invoice ✅ | Report ✅
Two-Factor Auth#
3. หน้าที่ FAIL ❌ (14 หน้า - ต้องแก้ไข)#
3.1 🔴 403 Forbidden (1 หน้า)#
| # | หน้า | Path | OLD | NEW | สาเหตุที่เป็นไปได้ |
|---|
| 1 | Rush to Sell | /period/rushtoSell | 200 | 403 | Middleware role (payment/admin/operation) อาจ block user Haru |
3.2 🔴 500 Internal Server Error (13 หน้า)#
| # | หน้า | Path | OLD | NEW | สาเหตุที่เป็นไปได้ |
|---|
| 2 | Booking List | /booking | 200 | 500 | Error ใน code - อาจ missing dependency หรือ DB issue |
| 3 | Payment Create | /payment/create | 200 | 500 | Error ใน code |
| 4 | Tickets | /tickets | 200 | 500 | Error ใน code |
| 5 | Promotion | /promotion | 200 | 500 | Error ใน code |
| 6 | Agency Sales Export | /agency/sales/export | 200 | 500 | Export function error |
| 7 | Setting Banner | /setting/banner | 200 | 500 | Error ใน code |
| 8 | Setting Flash Sale Banner | /setting/flashsale-banner | 200 | 500 | Error ใน code |
| 9 | Setting Promotions | /setting/promotions | 200 | 500 | Error ใน code |
| 10 | Reports Invoice Dep | /reports/invoice/dep | 200 | 500 | Error ใน code |
| 11 | Export All Booking | /export/allbooking | 200 | 500 | Export function error |
| 12 | Export All Booking Payment | /export/allBookingPayment | 200 | 500 | Export function error |
| 13 | REST Costing Init | /rest/costing/init | 200 | 500 | API error |
| 14 | REST Estimates | /rest/estimates | 200 | 500 | API error |
4. การวิเคราะห์สาเหตุ#
4.1 Error 500 - ส่วนใหญ่น่าจะเกิดจาก:#
1.
Database migration ไม่ครบ - ตาราง/คอลัมน์ขาดหายไปในระบบใหม่
2.
Config ต่างกัน - .env ของระบบใหม่อาจขาด config บางตัว
3.
Package/Dependency version ต่าง - PHP version หรือ package version ไม่ตรงกัน
4.
Storage permission - ไฟล์ export เขียนไม่ได้
5.
Missing data - ข้อมูลอ้างอิง (foreign key) ไม่ครบในระบบใหม่
4.2 วิธีตรวจสอบ Error 500:#
4.3 หน้าที่ FAIL แยกตามกลุ่ม:#
| กลุ่ม | จำนวน FAIL | รายการ |
|---|
| Export/Download | 3 | /export/allbooking, /export/allBookingPayment, /agency/sales/export |
| Settings (list) | 3 | /setting/banner, /setting/flashsale-banner, /setting/promotions |
| REST API | 2 | /rest/costing/init, /rest/estimates |
| หน้าหลัก | 5 | /booking, /payment/create, /tickets, /promotion, /reports/invoice/dep |
| Permission | 1 | /period/rushtoSell (403) |
5. สิ่งที่ค้นพบเพิ่มเติม#
5.1 BlockBadBots Middleware#
ไฟล์ app/Http/Middleware/BlockBadBots.php block curl User-Agent ทำให้ต้องใช้ browser User-Agent ในการทดสอบ5.2 TrustProxies ไม่ได้ตั้งค่า#
ไฟล์ app/Http/Middleware/TrustProxies.php → $proxies เป็น null
ควรตั้งเป็น '*' เพราะใช้ Cloudflare proxy5.3 APP_URL อาจเป็น http#
Redirect จาก / ไป http://... แทน https://...
ควรตั้ง APP_URL=https://probooking.mafservices.us ใน .env
6. แผนการแก้ไข (Action Plan)#
Priority 1: แก้ Error 500 (13 หน้า)#
1.
เปิด debug mode บน server ใหม่ (APP_DEBUG=true) ดู error message
2.
เช็ค laravel.log หาส าเหตุแต่ละหน้า
3.
รัน migration ถ้ายังไม่ได้รัน: php artisan migrate
4.
เช็ค storage permission: chmod -R 775 storage bootstrap/cache
Priority 2: แก้ Config#
5.
APP_URL=https://probooking.mafservices.us
APP_DEBUG=false
6.
แก้ TrustProxies (app/Http/Middleware/TrustProxies.php): Priority 3: ทดสอบซ้ำ#
7.
รัน bash migration_test.sh อีกครั้ง หลังแก้ไข
8.
ทดสอบด้วยมือ สำหรับ flow ที่ซับซ้อน (Booking, Payment, Export)
7. วิธีรัน Test#
Report จะบันทึกไว้ที่ /tmp/migration_test_report_*.txt
จัดทำโดย: Claude AI
วันที่: 25 มีนาคม 2026
ผลลัพธ์: 96/110 PASS (87%) | 14 FAIL ต้องแก้ไขModified at 2026-03-25 16:09:31