# Admin SMS Alerts Feature

## Overview
Added an admin phone number setting that receives SMS alerts when users make withdrawals or exchanges (excluding top-ups).

## Changes Made

### 1. Admin Settings Page (`resources/views/admin/settings.blade.php`)
- Added "Admin Alert Phone Number" field in the SMS Configuration section
- Field accepts phone numbers in format: +233XXXXXXXXX
- Includes helpful description: "Phone number to receive SMS alerts for withdrawals and exchanges (not top-ups)"

### 2. Admin Controller (`app/Http/Controllers/Admin/AdminController.php`)

#### Settings Method
- Added `admin_alert_phone` to the settings array loaded from database

#### Update Settings Method
- Added validation for `admin_alert_phone` field (nullable, max 20 characters)
- Added `Setting::set('admin_alert_phone', $request->admin_alert_phone)` to save the value

### 3. Dashboard Controller (`app/Http/Controllers/DashboardController.php`)

#### Withdraw Method
- Added SMS alert to admin when user submits withdrawal request
- Alert includes: user name, withdrawal amount, reference number, and Alipay account
- Only sends if `admin_alert_phone` is configured in settings
- Message format: "RMBXchange Alert: {User Name} requested withdrawal of ¥{Amount}. Ref: {Reference}. Alipay: {Account}"

### 4. Exchange Controller (`app/Http/Controllers/ExchangeController.php`)

#### Create Method
- Added SMS alert to admin when user creates exchange order
- Alert includes: user name, order number, GHS amount, and CNY amount
- Only sends if `admin_alert_phone` is configured in settings
- Message format: "RMBXchange Alert: {User Name} created exchange order #{Order Number}. ₵{GHS Amount} → ¥{CNY Amount}"

## Usage

1. Navigate to Admin Dashboard → Settings
2. Scroll to "SMS Configuration" section
3. Enter admin phone number in "Admin Alert Phone Number" field (e.g., +233XXXXXXXXX)
4. Save settings

Once configured, the admin will receive SMS alerts for:
- ✅ Withdrawal requests
- ✅ Exchange orders
- ❌ Top-ups (excluded as requested)

## Technical Details

- Uses existing `SmsService` class for sending SMS
- Retrieves admin phone from settings: `Setting::get('admin_alert_phone')`
- Only sends SMS if phone number is configured (graceful handling)
- SMS alerts are sent immediately after the transaction is created
- No additional database tables or migrations required
