<?php
require 'vendor/autoload.php';
$app = require_once 'bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();

use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Auth;

$user = User::where('email', 'reseller@demo.com')->first();
if (!$user) {
    echo "User not found\n";
    exit;
}

echo "User found: " . $user->name . "\n";
echo "Role: " . $user->role . "\n";
echo "Status: " . $user->reseller_status . "\n";

$passMatches = Hash::check('12345678', $user->password);
echo "Password check: " . ($passMatches ? "PASS" : "FAIL") . "\n";

$attemptMatches = Auth::attempt(['email' => 'reseller@demo.com', 'password' => '12345678']);
echo "Auth::attempt check: " . ($attemptMatches ? "PASS" : "FAIL") . "\n";
