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

use App\Models\Proveedor;

try {
    $rows = Proveedor::where('categoria', 'telas')->get();
    echo "Found " . $rows->count() . " proveedores with categoria=telas\n";
    foreach ($rows as $r) {
        echo "- {$r->id}: {$r->nombre} ({$r->categoria})\n";
    }
} catch (Throwable $e) {
    echo "Error: " . get_class($e) . " - " . $e->getMessage() . "\n";
    echo $e->getTraceAsString();
}
