<?php
use App\Models\User;
use App\Models\Ad;
require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__ . '/bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();

$email = 'test@clxpro.com';
$user = User::where('email', $email)->first();

if (!$user) {
    echo "User not found\n";
    exit;
}

echo "User ID: {$user->id}\n";
$ads = Ad::where('user_id', $user->id)->get();
echo "Ads Count: " . $ads->count() . "\n";

foreach ($ads as $ad) {
    echo "- Ad ID: {$ad->id}, Title: {$ad->title}, Status: {$ad->status}\n";
}
