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:
- Laravel Breeze a partir de la versión 12 - https://youtu.be/nb6tVybM1Rk
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:
- Optimiza tus archivos de Laravel ANTES de producción - https://youtu.be/NbV23ToRJ-8
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:
- Conclusiones al terminar en Curso/Libro Laravel 12 Inertia 2 - https://youtu.be/VMnJzJHd_SI
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:
- ChatGTP y su recomendación para manejar la Cache en Laravel NO tiene SENTIDOOO!! - https://youtu.be/P9kqAJZTSM0
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:
- Esto NOOOOO Es un Componente, ES una Vista un Engaño, NOO Es Modular: Laravel Inertia vs Livewire - https://youtu.be/No5cUdfz4Jc
Truncating data in Django: Changing the subject, I also uploaded a video showing how to truncate data in Django templates:
- Listado, truncar datos de la descripción: truncatechars:'150' - Django - 33 - https://youtu.be/2Bj99KH-NVE
Creating an automated index: something I'm very happy about because it will help me with my books:
- Como crear un Índice automatizado Paso a Paso de un Documento/Página HTML - https://youtu.be/pKsyFLsm9Bo
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:
- Los Desarrolladores NO nos quedaremos sin trabajo por la IA, pero los JUNIORS... - https://youtu.be/UCWJWIM7DXc
My work desk: A video I recorded a couple of months ago showing my workspace and some tips to be more productive:
- Mi Setup o ambiente de Trabajo, te muestro mis secretos que nadie MAS te dice - https://youtu.be/JKC_7vP3m7o
Integración con PayPal: explicación sobre cómo integrar PayPal en Django, utilizando la CDN del cliente:
- PayPal: Integración con el Cliente - JavaScript CDN : Primeros pasos - 21 - https://youtu.be/xpX6n3eXDI8
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!
- Mis Libros de Desarrollo de Software Lucirán MEJOR que Nunca! - https://youtu.be/4ix3e0WZvOU
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:
- Introducción
- Categoría
- Post
- Book
- Payment
- Ejecutar migraciones
- 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:
Remover opción de agregar el producto en detalle si ya está en el carrito
Si el item esta en el carrito, quitamos la opción desde el detalle.
En detalle, resaltar producto en el carrito
En detalle, vamos a resaltar el item actual en el carrito.
Propiedad Refresh
Vamos a hablar sobre la propiedad de refresh de los componente de Laravel
Repaso: Eventos personalizados del padre a hijo y viceversa
Damos un repaso a los eventos personalizados en Laravel
Recargar operaciones en listado
Vamos a recargar el detalle al hacer una operación en el cartItem mediante un evento.
Definir una key para listado del carrito en detalle
Vamos a forzar el recargado de componentes que no se quieren redibujar con el listado del carrito.
Otra forma de recargar el listado
Veremos otra sintaxis para utilizar la propiedad refresh y los eventos personalizados.
En detalle, Animación al agregar producto en el carrito
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.