<?php

require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

echo "Testing Marketing Officer Public API\n";
echo "=====================================\n\n";

$controller = new \App\Http\Controllers\Api\V1\Immigopro\MarketingOfficerController();
$response = $controller->getPublicList();
$data = json_decode($response->getContent(), true);

echo "Response: " . $response->getContent() . "\n\n";

if ($data['success']) {
    echo "✓ API working! Found " . count($data['data']) . " marketing officers\n";
    foreach ($data['data'] as $officer) {
        echo "  - {$officer['name']} (ID: {$officer['id']})\n";
    }
} else {
    echo "✗ API failed\n";
}
