From ffe39d8d9805bc5abd76f7481dbc7ef5ac2d9003 Mon Sep 17 00:00:00 2001 From: BryamE Date: Thu, 11 Dec 2025 13:03:22 -0300 Subject: [PATCH] Cambios en vistas de catalogo, mejoras visuales y creado componente para ver el producto como invitado --- resources/views/catalogo.blade.php | 3 +- .../views/components/ui/imgcard.blade.php | 31 +++++++++++++++++++ resources/views/welcome.blade.php | 18 ++++++++--- routes/web.php | 2 +- 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 resources/views/components/ui/imgcard.blade.php diff --git a/resources/views/catalogo.blade.php b/resources/views/catalogo.blade.php index 3a4eecc..1b47400 100644 --- a/resources/views/catalogo.blade.php +++ b/resources/views/catalogo.blade.php @@ -8,7 +8,8 @@ @if ($products->count() > 0)
@foreach ($products as $prod) -
+ +
{{-- Imagen si existe --}} @if (!empty($prod->img)) {{ $prod->name }} '#', 'title', 'description', 'price', 'image' => null]) + +
+ {{-- Imagen si existe --}} + @if ($image) + {{ $title }} + @else +
+ Sin imagen +
+ @endif + + {{-- Nombre --}} +

{{ $title }}

+ + {{-- Descripción corta --}} +
+ @if (!empty($description)) +

{{ $description }}

+ @endif +
+ + {{-- Precio --}} +

${{ number_format($price, 2, ',', '.') }}

+ + {{-- Botón --}} + + Ver producto + +
\ No newline at end of file diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index e412c1e..05b8208 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -1,4 +1,14 @@ - - Lauck - Inicio - Bienvenido - + + + + + + \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index db78519..f416a7c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -14,6 +14,7 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; Route::get('/',HomeController::class); +Route::get('/catalogo', [CatalogoController::class,'catalogo'])->name('catalogo'); Route::get('login', function(){ return view('login'); @@ -52,5 +53,4 @@ Route::middleware(['auth'])->group(function () { }); -Route::get('/catalogo', [CatalogoController::class,'catalogo'])->name('catalogo'); Route::get('/productos/{id}/vistaUsuario', [ProductosController::class,'vistaUsuario'])->name('productos.vistaUsuario'); \ No newline at end of file