CAMBIOS: Creado un "ProductSeeder" Para la carga de productos del excel. Falta cargar los productos.
This commit is contained in:
@@ -77,5 +77,7 @@ class DatabaseSeeder extends Seeder
|
||||
'problem_description' => 'Service completo y ajuste de cambios',
|
||||
'status' => 'pending'
|
||||
]);
|
||||
|
||||
$this->call(ProductSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Product;
|
||||
|
||||
class ProductSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Productos del Excel
|
||||
$products = [
|
||||
// 1. BICICLETAS
|
||||
[
|
||||
'name' => 'Bicicleta Venzo Loki R29',
|
||||
'sku' => 'BIC-VEN-001',
|
||||
'price' => 450000,
|
||||
'cost' => 300000,
|
||||
'stock_quantity' => 2,
|
||||
'min_stock_alert' => 1,
|
||||
'type' => 'bike', // bike, accessory, clothing, spare
|
||||
],
|
||||
[
|
||||
'name' => 'Cámara 29 Valvula Auto',
|
||||
'sku' => 'CAM-29-A',
|
||||
'price' => 5000,
|
||||
'cost' => 2500,
|
||||
'stock_quantity' => 50,
|
||||
'min_stock_alert' => 10,
|
||||
'type' => 'accessory',
|
||||
],
|
||||
[
|
||||
'name' => 'Servicio de Lavado',
|
||||
'sku' => 'SRV-LAV',
|
||||
'price' => 3000,
|
||||
'cost' => 0,
|
||||
'stock_quantity' => 999,
|
||||
'min_stock_alert' => 0,
|
||||
'type' => 'service',
|
||||
],
|
||||
];
|
||||
|
||||
// BUCLE DE CARGA
|
||||
foreach ($products as $item) {
|
||||
Product::updateOrCreate(
|
||||
['sku' => $item['sku']],
|
||||
[
|
||||
'name' => $item['name'],
|
||||
'price' => $item['price'],
|
||||
'cost' => $item['cost'] ?? 0,
|
||||
'stock_quantity' => $item['stock_quantity'] ?? 0,
|
||||
'min_stock_alert' => $item['min_stock_alert'] ?? 5,
|
||||
'type' => $item['type'] ?? 'accessory',
|
||||
'description' => $item['description'] ?? null,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,20 +31,20 @@
|
||||
@auth
|
||||
<li>
|
||||
<a href="{{ url('/dashboard') }}"
|
||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('dashboard') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||
Dashboard
|
||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('dashboard') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||
Inicio
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url('/productos') }}"
|
||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('productos*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||
Stock
|
||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('productos*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||
Stock
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('taller.index') }}"
|
||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('taller*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||
Taller
|
||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('taller*') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||
Taller
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -83,8 +83,8 @@
|
||||
<!-- Botón Login Resaltado -->
|
||||
<li>
|
||||
<a href="{{ route('login') }}"
|
||||
class="block py-2 px-5 text-center text-neutral-900 bg-neon-lime font-black rounded hover:bg-[#b3e600] transition-colors uppercase tracking-wider text-xs shadow-lg shadow-neon-lime/20 hover:shadow-neon-lime/40 transform hover:-translate-y-0.5 duration-200">
|
||||
Ingresar
|
||||
class="block py-2 px-5 text-center text-neutral-900 bg-neon-lime font-black rounded hover:bg-[#b3e600] transition-colors uppercase tracking-wider text-xs shadow-lg shadow-neon-lime/20 hover:shadow-neon-lime/40 transform hover:-translate-y-0.5 duration-200">
|
||||
Ingresar
|
||||
</a>
|
||||
</li>
|
||||
@endguest
|
||||
|
||||
@@ -9,30 +9,41 @@
|
||||
|
||||
<!-- Grid de Tarjetas -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 w-full mb-12">
|
||||
|
||||
<!-- Tarjeta Catálogo -->
|
||||
<x-ui.card href="{{ url('/catalogo') }}" title="Catálogo" description="Administrar bicicletas y repuestos." linkText="Ir al stock">
|
||||
<x-ui.card href="{{ url('/catalogo') }}" title="Catálogo" description="Ver productos." linkText="Ir al catalogo">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Tarjeta Productos -->
|
||||
<x-ui.card href="{{ url('/productos') }}" title="Stock" description="Administrar bicicletas y repuestos." linkText="Ir al stock">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Tarjeta Taller -->
|
||||
<x-ui.card href="{{ url('/taller') }}" title="Taller" description="Gestión de services y reparaciones." linkText="Ver agenda">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Tarjeta Clientes -->
|
||||
<x-ui.card href="{{ url('/clients') }}" title="Clientes" description="Base de datos de ciclistas." linkText="Buscar usuario">
|
||||
<x-ui.card href="{{ url('/clients') }}" title="Clientes" description="Base de datos de ciclistas." linkText="Ver Clientes">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Tarjeta Proveedores -->
|
||||
<x-ui.card href="#" title="Proveedores" description="Base de datos de proveedores." linkText="Ver Proveedores">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Tarjeta Ventas -->
|
||||
<x-ui.card href="{{ url('/sales') }}" title="Ventas" description="Registro de Ventas" linkText="Ver Ventas">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Tarjeta Compras -->
|
||||
<x-ui.card href="#" title="Gastos" description="Registro de compras y pedidos a proovedores." linkText="Ver Gastos">
|
||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||
</x-ui.card>
|
||||
|
||||
<!-- Estadísticas (Sin template) -->
|
||||
<div class="p-6 bg-gradient-to-br from-neutral-800 to-neutral-900 border border-neutral-700 rounded-xl flex flex-col justify-center items-center text-center">
|
||||
<span class="text-4xl font-black text-white">85%</span>
|
||||
<span class="text-xs uppercase tracking-widest text-gray-500 mt-1">Eficiencia Taller</span>
|
||||
<div class="w-full bg-gray-700 rounded-full h-1.5 mt-4">
|
||||
<div class="bg-neon-lime h-1.5 rounded-full" style="width: 85%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Botón de Logout -->
|
||||
|
||||
Reference in New Issue
Block a user