# 🔧 HƯỚNG DẪN BẢNG TRÌNH BẢO TRÌ HỆ THỐNG

## Cách BẬT chế độ bảo trì:

### Cách 1: Dùng PowerShell (Windows)
```powershell
New-Item -Path storage\.maintenance -ItemType File -Force
```

### Cách 2: Dùng Command Prompt (Windows)
```cmd
type nul > storage\.maintenance
```

### Cách 3: Dùng Terminal/Bash (Linux/Mac)
```bash
touch storage/.maintenance
```

---

## Cách TẮT chế độ bảo trì:

### Cách 1: Dùng PowerShell (Windows)
```powershell
Remove-Item storage\.maintenance -Force
```

### Cách 2: Dùng Command Prompt (Windows)
```cmd
del storage\.maintenance
```

### Cách 3: Dùng Terminal/Bash (Linux/Mac)
```bash
rm storage/.maintenance
```

---

## Cách Nhanh - Dùng PHP Artisan (Nếu có Artisan Command tùy chỉnh):

### Bật bảo trì:
```bash
php artisan down
```

### Tắt bảo trì:
```bash
php artisan up
```

---

## ✅ Xác Minh

Khi đã bật bảo trì:
- Truy cập vào bất kỳ URL nào (ví dụ: http://localhost/xxx)
- Bạn sẽ thấy trang thông báo bảo trì ✨

---

## 📝 Lưu Ý

- File `.maintenance` được lưu tại thư mục `storage/`
- Thư mục `storage/` cần có quyền ghi (writable)
- Trang bảo trì được lưu tại: `resources/views/maintenance.blade.php`
- Middleware: `app/Http/Middleware/CheckMaintenance.php`
