Update week 19May-02Jun - SEO Lazy Loading Laravel - FastAPI Testing - Gem System

Video thumbnail

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:

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:

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:

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.

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:

  1. Capa 1: Clase que se encarga directamente del pago con PayPal. No le interesa qué producto se está comprando.
  2. Capa 2: Gestión de pasarelas de pago (PayPal y Stripe).
  3. 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:

  1. PayPal, Primeros pasos

  2. PayPal, Resumen de la Implementación

    1. Veremos cómo quedó la configuración en base a la implementación anterior.

  3. Adaptar PayPal: Parámetros importantes del pago

    1. Vamos a identificar y crear propiedades para cada dato que nos interese registrar como el ir del pago, estado, traza, etc.

  4. Adaptar PayPal: Establecer Parámetros del pago

    1. Vamos a establecer los parámetros definidos anteriormente en base a la respuesta de PayPal.

  5. Controlador base de pago

    1. Vamos a crear el controlador de pago y convertir la clase de PayPal a un trait.

  6. Controlador base de pago: Método para procesar el pago

    1. Vamos a crear un método global para procesar los pagos de PayPal y Stripe.

  7. BookController: Estructura base

    1. Creamos la estructura base de la clase book para recibir el pago.

  8. BookController: Generar el Payment

    1. Vamos a crear un pago a un libro.

  9. Definir BasePayment cómo abstract

    1. Definimos la clase de pago como abstracta para que no puedas crear rutas.

  10. Componente de pago para PayPal

    1. Vamos a crear un componente de Laravel para incorporar el plugin de pago.

  11. Stripe, Resumen de la Implementación

    1. Veremos cómo quedó la configuración en base a la implementación anterior.

  12. Adaptar Stripe

    1. 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

En español