Update week 19May-02Jun - SEO Lazy Loading Laravel - FastAPI Testing - Gem System
Welcome to another week. I'm going to share the updates that occurred between the week of May 26th and June 2nd, starting—as always—with news for the YouTube channel and also for the blog.
YouTube/Blog
Here's an interesting video that follows the same theme as the original CodeIgniter 4 course, focusing on consuming the application through the REST API with an interface built in Vue.
I'm already working on the final details, and I think I've practically published them all. Some of the points I covered were:
- Ajustes de CSS (tamaños de texto, centrado).
- Mejora de la interfaz gráfica.
- Componente de carta utilizando UI, Vue y Tailwind.
- Diálogo de confirmación y ajustes visuales.
The videos are:
- Tailwind CSS: Textos, tamaños, centrados y más - Vue + Rest Api CodeIgniter - 41 - https://youtu.be/n-azgfq02KM
- Tailwind + Vue + Oruga UI: Componente de Carta - 44 - https://youtu.be/2FDxIZE1uPI
- Tailwind: Diálogo de Eliminar, Espaciado y Flex #-Vue3 - 42 - https://youtu.be/VeZbNK74bJU
This is all part of the original course, so these were finishing touches.
SEO en Laravel: Carga diferida y renderizado de contenido
También terminé de publicar el último video de una lista de reproducción enfocada en SEO en Laravel. En mi opinión, la parte más interesante es la que llamo “Carga diferida y render del contenido”.
There I show you how, if you don't have the final content defined in the initial load, you can automatically generate it at that time. This allowed me to:
- Evitar cargar el plugin Highlight.js después.
- Renderizar contenido automáticamente.
TRUCAZO para el SEO en Laravel, Carga Diferida y Pre Render del contenido 4 - https://youtu.be/N2vvVsyBk2A
Additionally, I explain how I generated a professional EPUB, especially useful in cases such as generating PDFs of books, using the DOMPDF plugin, which is compatible with Laravel, CodeIgniter, pure PHP or any other stack, since it is not exclusive to Laravel:
- Generar un EPUB PROFESIONAL en Laravel o cualquier aplicación en PHP (CodeIgniter) - https://youtu.be/3RVCcEBFKY8
- Mi Kit de Desarrollo para Laravel 2025 - Windows y MacOS - https://youtu.be/T_kacBkExPw
I'm trying out other formats for my courses. In this case, I recorded several lectures in one for the testing section of the FastAPI course using Pytest, aiming to make it more concise:
- MASTER CLASE - Pruebas/Testing en FastAPI con Pytest - https://youtu.be/2Ky5lfIzGxw
Points System on the Academy Platform
Another thing I found interesting is that I'm constantly working on my academic platform, which also has a web app.
I implemented a points or gems system, inspired by Duolingo, where you need to spend a point to watch a class. These points are earned by watching ad-blocking ads in the mobile app.
The points you unlock in the mobile app can also be used on the web or within the app itself. In principle, all courses are available through this system. Some books will also be unlocked, but not all.
- Academia Ver Cursos/Libros de Manera Gratuita con sistema de Publicidad (ADS) - https://www.youtube.com/playlist?list=PLB5SYDBi8M3E4HwxabjPaMGdrAd2-WxWE
- ¿Por qué usar el sistema de Puntos/Gemas en vez de Youtube? - https://youtu.be/kGeKV93PLmw
Online Store Course with Laravel + Livewire
Regarding the new online store course using Laravel and Livewire, we worked on the PayPal integration. I've uploaded the complete implementation of the basics, in case you have any questions.
This was a continuation of the original Laravel course, but now with a more advanced and modular approach:
The original course only showed how to make a basic payment, without associating it with any model.
Now we're looking for a modular, scalable, and maintainable solution.
We implemented a three-tier system:
- Capa 1: Clase que se encarga directamente del pago con PayPal. No le interesa qué producto se está comprando.
- Capa 2: Gestión de pasarelas de pago (PayPal y Stripe).
- Capa 3: Lógica de negocios según el tipo de producto (libros, cursos, etc.).
This way, if you need to sell a new type of product in the future or the PayPal API changes, you won't have to rewrite the logic multiple times. You just adapt the corresponding layer.
We did the same with Stripe. As I mentioned in the base course, this section also starts with an overview and then adapts the integration to our three-layer modular system:
PayPal, Primeros pasos
PayPal, Resumen de la Implementación
Veremos cómo quedó la configuración en base a la implementación anterior.
Adaptar PayPal: Parámetros importantes del pago
Vamos a identificar y crear propiedades para cada dato que nos interese registrar como el ir del pago, estado, traza, etc.
Adaptar PayPal: Establecer Parámetros del pago
Vamos a establecer los parámetros definidos anteriormente en base a la respuesta de PayPal.
Controlador base de pago
Vamos a crear el controlador de pago y convertir la clase de PayPal a un trait.
Controlador base de pago: Método para procesar el pago
Vamos a crear un método global para procesar los pagos de PayPal y Stripe.
BookController: Estructura base
Creamos la estructura base de la clase book para recibir el pago.
BookController: Generar el Payment
Vamos a crear un pago a un libro.
Definir BasePayment cómo abstract
Definimos la clase de pago como abstracta para que no puedas crear rutas.
Componente de pago para PayPal
Vamos a crear un componente de Laravel para incorporar el plugin de pago.
Stripe, Resumen de la Implementación
Veremos cómo quedó la configuración en base a la implementación anterior.
Adaptar Stripe
Hablamos del código necesario para seguir la implementación.
Acepto recibir anuncios de interes sobre este Blog.
YouTube/Blog Visual Details App API + RestAPI C4 - SEO and Laravel, Lazy Loading - My Laravel Development Kit - Epub in Laravel - Fast Api - Epub Generation - Gem System Course/Book Laravel Livewire Online Store - 3-Layer System for Making Payments with PayPal and Stripe
- Andrés Cruz