Merge branch 'bryam' of https://github.com/BryamE/ProyectoLauck into lucas
This commit is contained in:
@@ -1,36 +1,41 @@
|
|||||||
<x-appc>
|
<x-layout title="Catalogo - Lauck">
|
||||||
<div class="max-w-6xl mx-auto px-4 py-8">
|
|
||||||
<h1 class="text-center text-2xl font-bold mb-8">CATÁLOGO</h1>
|
<!-- Header -->
|
||||||
|
<x-section-header subtitle="Inicio" title="Catalogo de " highlight="Productos"/>
|
||||||
|
|
||||||
|
<div class="w-full max-w-5xl">
|
||||||
|
|
||||||
@if ($products->count() > 0)
|
@if ($products->count() > 0)
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
|
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
|
||||||
@foreach ($products as $prod)
|
@foreach ($products as $prod)
|
||||||
<div class="p-4 border rounded-lg shadow-md bg-white hover:shadow-lg transition">
|
<div class="group p-4 border border-neutral-800 rounded-xl hover:border-neon-lime hover:-translate-y-1 transition-all duration-300 shadow-lg hover:shadow-neon-lime/20">
|
||||||
{{-- Imagen si existe --}}
|
{{-- Imagen si existe --}}
|
||||||
@if (!empty($prod->imagen))
|
@if (!empty($prod->img))
|
||||||
<img src="{{ asset('storage/' . $prod->imagen) }}" alt="{{ $prod->name }}"
|
<img src="{{ asset('storage/' . $prod->img) }}" alt="{{ $prod->name }}"
|
||||||
class="w-full h-40 object-cover rounded mb-4">
|
class="w-full h-40 object-cover rounded mb-4">
|
||||||
@else
|
@else
|
||||||
<div class="w-full h-40 bg-gray-200 flex items-center justify-center rounded mb-4">
|
<div class="w-full h-40 bg-lime-500 flex items-center justify-center rounded mb-4">
|
||||||
<span class="text-gray-500 text-sm">Sin imagen</span>
|
<span class="text-neutral-900 text-md uppercase font-bold">Sin imagen</span>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- Nombre --}}
|
{{-- Nombre --}}
|
||||||
<h2 class="text-lg font-semibold text-gray-800">{{ $prod->nombre }}</h2>
|
<h2 class="text-lg font-semibold text-white">{{ $prod->name }}</h2>
|
||||||
|
|
||||||
{{-- Descripción corta --}}
|
{{-- Descripción corta --}}
|
||||||
@if (!empty($prod->descripcion))
|
<div class="h-10 overflow-y-auto [scrollbar-width:none]">
|
||||||
<p class="text-sm text-gray-600 mt-2">{{ $prod->descripcion }}</p>
|
@if (!empty($prod->description))
|
||||||
|
<p class="text-sm text-gray-400 mt-2">{{ $prod->description }}</p>
|
||||||
@endif
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
{{-- Precio --}}
|
{{-- Precio --}}
|
||||||
@if (!empty($prod->precio))
|
@if (!empty($prod->price))
|
||||||
<p class="text-blue-600 font-bold mt-3">${{ number_format($prod->precio, 2, ',', '.') }}</p>
|
<p class="text-white group-hover:text-neon-lime font-bold mt-3 transition-colors">${{ number_format($prod->price, 2, ',', '.') }}</p>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- Botón --}}
|
{{-- Botón --}}
|
||||||
<a href="{{ route('productos.vistaUsuario', $prod) }}"
|
<a href="{{ route('productos.show', $prod) }}"
|
||||||
class="mt-4 block w-full bg-blue-500 text-white py-2 rounded-lg text-center hover:bg-blue-600">
|
class="mt-4 block w-full bg-blue-500 text-white py-2 rounded-lg text-center hover:bg-blue-600">
|
||||||
Ver producto
|
Ver producto
|
||||||
</a>
|
</a>
|
||||||
@@ -42,4 +47,4 @@
|
|||||||
<p class="text-center text-gray-600 mt-10">No hay productos disponibles.</p>
|
<p class="text-center text-gray-600 mt-10">No hay productos disponibles.</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</x-appc>
|
</x-layout>
|
||||||
|
|||||||
@@ -40,13 +40,13 @@
|
|||||||
<body class="bg-dark-bg text-gray-300 font-sans antialiased min-h-screen flex flex-col relative overflow-x-hidden">
|
<body class="bg-dark-bg text-gray-300 font-sans antialiased min-h-screen flex flex-col relative overflow-x-hidden">
|
||||||
|
|
||||||
<!-- Fondo grilla global -->
|
<!-- Fondo grilla global -->
|
||||||
<div class="absolute inset-0 bg-grid-pattern opacity-[0.07] z-0 pointer-events-none fixed"></div>
|
<div class="inset-0 bg-grid-pattern opacity-[0.07] z-0 pointer-events-none fixed"></div>
|
||||||
|
|
||||||
<!-- Navbar Component -->
|
<!-- Navbar Component -->
|
||||||
<x-navbar />
|
<x-navbar />
|
||||||
|
|
||||||
<!-- Contenido Principal -->
|
<!-- Contenido Principal -->
|
||||||
<main class="flex-grow flex flex-col items-center justify-start pt-10 pb-20 px-4 w-full max-w-7xl mx-auto z-10">
|
<main class="grow flex flex-col items-center justify-start pt-10 pb-20 px-4 w-full max-w-7xl mx-auto z-10">
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
@@ -7,37 +7,37 @@
|
|||||||
<dl class="w-lg text-gray-900 dark:text-white *:border-b *:border-gray-200 *:dark:border-gray-400">
|
<dl class="w-lg text-gray-900 dark:text-white *:border-b *:border-gray-200 *:dark:border-gray-400">
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Marca</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Marca</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->marca}}</dd>
|
<dd class="text-lg font-semibold">{{$product->name}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Modelo</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Modelo</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->modelo}}</dd>
|
<dd class="text-lg font-semibold">{{$product->sku}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Color</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Color</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->color}}</dd>
|
<dd class="text-lg font-semibold">{{$product->description}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Rodado</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Rodado</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->rodado}}</dd>
|
<dd class="text-lg font-semibold">{{$product->cost}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Tipo</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Tipo</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->tipo}}</dd>
|
<dd class="text-lg font-semibold">{{$product->price}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Descripcion</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Descripcion</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->descripcion}}</dd>
|
<dd class="text-lg font-semibold">{{$product->stock_quantity}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col pt-3">
|
<div class="flex flex-col pt-3">
|
||||||
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Precio</dt>
|
<dt class="mb-1 text-gray-500 md:text-lg dark:text-gray-400">Precio</dt>
|
||||||
<dd class="text-lg font-semibold">{{$producto->precio}}</dd>
|
<dd class="text-lg font-semibold">{{$product->type}}</dd>
|
||||||
</div>
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="flex gap-5">
|
<div class="flex gap-5">
|
||||||
<a href="{{route('productos.index')}}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-stone-500 hover:bg-stone-600">Volver</a>
|
<a href="{{route('productos.index')}}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-stone-500 hover:bg-stone-600">Volver</a>
|
||||||
<a href="{{route('productos.edit',$producto)}}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-blue-600 hover:bg-blue-700">Editar</a>
|
<a href="{{ route('productos.edit', $product ) }}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-blue-600 hover:bg-blue-700">Editar</a>
|
||||||
<form action="{{route('productos.destroy',$producto)}}" method="post">
|
<form action="{{route('productos.destroy',$product)}}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
@method('DELETE')
|
@method('DELETE')
|
||||||
<button type="submit" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-red-600 hover:bg-red-700">
|
<button type="submit" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-red-600 hover:bg-red-700">
|
||||||
|
|||||||
+1
-3
@@ -41,12 +41,10 @@ Route::post('register', RegisterController::class)->name('register.store');
|
|||||||
|
|
||||||
Route::middleware(['auth'])->group(function () {
|
Route::middleware(['auth'])->group(function () {
|
||||||
Route::resource('productos', ProductosController::class)->parameters([
|
Route::resource('productos', ProductosController::class)->parameters([
|
||||||
'products' => 'product'
|
'productos' => 'product'
|
||||||
]);
|
]);
|
||||||
Route::resource('clients', ClientController::class);
|
Route::resource('clients', ClientController::class);
|
||||||
Route::get('/checker', [ProductosController::class, 'checker'])->name('productos.checker');
|
Route::get('/checker', [ProductosController::class, 'checker'])->name('productos.checker');
|
||||||
Route::get('/productos/{id}', [ProductosController::class,'show'])->name('productos.show');
|
|
||||||
Route::get('/productos/{id}/edit', [ProductosController::class,'edit'])->name('productos.edit');
|
|
||||||
|
|
||||||
//Route::get('/sales', [SaleController::class, 'index'])->name('sales.index');
|
//Route::get('/sales', [SaleController::class, 'index'])->name('sales.index');
|
||||||
Route::get('/sales/create', [SaleController::class, 'create'])->name('sales.create');
|
Route::get('/sales/create', [SaleController::class, 'create'])->name('sales.create');
|
||||||
|
|||||||
Reference in New Issue
Block a user