Update week 21Apr-28Apr - Production Tips, my ChatGTP and Cache Setup, Shopping Cart Livewire

Welcome to another week of updates! Let me quickly share the highlights from these days.

YouTube/Blog

As always, we're starting with a recap of the previous update. This week we have some new features related to Laravel Breeze starting with version 12. This is one of the videos I recorded a while back for the original Laravel course:

Optimize your Laravel files in production: I recommend watching this video if you're going to upload your project to production. I explain some tips I had overlooked the first time I recorded this:

Finally, by the gods, I finished updating the Laravel Inertia course to version 2 with Laravel 12!
It's really a bit of a chore, but the thing I struggled with most here was the blessed new layout, which is where we've seen the biggest changes. Also, the components are slightly different internally, although the core remains practically the same:

Aquí también tengo algo interesante: una recomendación muy extraña que me hizo ChatGPT sobre el uso de la caché.
Según él, la caché todavía interpreta el HTML en el servidor, lo cual no es cierto. Justamente el chiste de la caché es que guarda el HTML ya interpretado para evitar reprocesarlo.
Te lo dejo para que lo analices, pero creo que aquí es donde nosotros, los desarrolladores, debemos interpretar y validar las sugerencias de la IA. La mayoría de las veces son correctas, pero siempre debemos evaluar su implementación:

This brings us to what I believe will be the future of our work: we will stop doing routine tasks and become analysts of solutions proposed by AI. This way, we will be much more efficient.

One of the things I don't like about Inertia is that we don't have real components.
If I open the general file, there, before rendering, we can perform several operations. That is a real component because it is independent of the rest of the application.

But in Inertia, we simply load a view. I explain all of this better in this video:

Truncating data in Django: Changing the subject, I also uploaded a video showing how to truncate data in Django templates:

Creating an automated index: something I'm very happy about because it will help me with my books:

A video about AI: where I reflect on how AI won't put us out of work, but it will affect juniors more, as it can solve tasks in seconds:

My work desk: A video I recorded a couple of months ago showing my workspace and some tips to be more productive:

Integración con PayPal: explicación sobre cómo integrar PayPal en Django, utilizando la CDN del cliente:

I'm very happy because now my books will look much better visually.
The whole process is automated: I have the source code segmented by chapters or sections, and I already have line breaks and code highlighting.

It was a bit of a challenge to achieve, but it also allowed me to improve my blog's SEO.
I'm going to start publishing videos on this topic, sharing useful tips for improving SEO in Laravel projects (or any similar system).

Now I can avoid the tedious use of Google Docs. Everything is generated automatically!

Courses and books in development

New Laravel course/book: I'm starting a new course, no longer basic, but rather intermediate-level. We'll focus on creating migrations for an online store:

  1. Introducción
  2. Categoría
  3. Post
  4. Book
  5. Payment
  6. Ejecutar migraciones
  7. Código fuente

Laravel 12 and Livewire 3 Update: I'm still working on this update, although I'm slowing down a bit because I want to add a lot of improvements, especially to the shopping cart:

  1. Remover opción de agregar el producto en detalle si ya está en el carrito

    1. Si el item esta en el carrito, quitamos la opción desde el detalle.

  2. En detalle, resaltar producto en el carrito

    1. En detalle, vamos a resaltar el item actual en el carrito.

  3. Propiedad Refresh

    1. Vamos a hablar sobre la propiedad de refresh de los componente de Laravel

  4. Repaso: Eventos personalizados del padre a hijo y viceversa

    1. Damos un repaso a los eventos personalizados en Laravel

  5. Recargar operaciones en listado

    1. Vamos a recargar el detalle al hacer una operación en el cartItem mediante un evento.

  6. Definir una key para listado del carrito en detalle

    1. Vamos a forzar el recargado de componentes que no se quieren redibujar con el listado del carrito.

  7. Otra forma de recargar el listado

    1. Veremos otra sintaxis para utilizar la propiedad refresh y los eventos personalizados.

  8. En detalle, Animación al agregar producto en el carrito

    1. Creamos una sencilla animación para mostrar/ocultar la opción de agregar un item al carrito

I'm fixing things I didn't like: I've added animations, better component refresh management using the refresh property, events between parent and child components, and more.

Here you can see how I've improved the cart screen: now, when the quantity drops to zero, the product disappears animatedly, and the same thing happens when adding it again.
All of this doesn't happen on its own: it's part of what we're covering in the new classes.

Acepto recibir anuncios de interes sobre este Blog.

YouTube, Blog - Laravel to production tips - ChatGTP and the cache - Inertia does NOT use components - Create an HTML index - my setup Courses/Books - Laravel Shopping, initial migrations - Shopping cart

- Andrés Cruz

En español