Latest Updates

Documenting code, one commit at a time.

Pest PHP 10 posts
×

Taming Filament: Resolving API Incompatibilities in a Laravel Package

When integrating third-party packages into a Laravel application, API compatibility issues can lead to frustrating errors and broken functionality. Recently, while working on the Reimpact platform, we encountered such challenges with the Filament admin panel when integrating an Ecodesign module.

The Problem: Fatal Errors and Broken Builds

The Ecodesign module, developed against a different

Read more
PHP

Crafting Image Prompts with Scene-Specific Structures

The Breniapp/brenia project is focused on image generation. A new feature has been implemented to structure image prompts based on the scene type, allowing for more tailored and realistic outputs.

The Problem: Generic Prompts

Previously, image prompts were often generic, leading to inconsistent and sometimes unrealistic results. A single prompt structure couldn't effectively capture the

Read more
PHP Stripe

Adding Payment Flexibility with Multiple Gateways

In the fast-evolving landscape of e-commerce, limiting payment options can be a barrier to customer acquisition, especially in diverse markets. Integrating multiple payment gateways can significantly enhance user experience and broaden market reach.

Expanding Payment Options

Supporting only one payment gateway can restrict your application's accessibility to users who prefer or require

Read more

Code Style Consistency in Breniapp/brenia with php-cs-fixer

Introduction

Maintaining a consistent code style is crucial for any project, especially when multiple developers are contributing. This post delves into how the Breniapp/brenia project enforces code style using php-cs-fixer, focusing on Livewire dispatch calls.

The Importance of Code Style

Consistent code style improves readability, reduces cognitive load, and minimizes merge

Read more

Localizing the Breniapp: From Session to User Database

The Breniapp project aims to streamline [description]. Recently, we tackled an issue with the locale switcher that was causing inconsistencies in how user locales were being handled.

The Problem

Previously, the locale selected by a user was only being saved in the session and a cookie. This approach relied on a two-step redirect chain through a LocaleController.

Read more
PHP

Improving Gemini Compatibility with System Prompts in Landing

Introduction

The landing project focuses on creating streamlined user experiences. A recent update ensures compatibility with the Gemini provider by correctly implementing system prompts within the InterviewSimulatorService.

The Problem: System Messages vs. System Prompts

Older Large Language Models (LLMs) often handle system messages as part of the overall message array.

Read more

Improving Job Reliability with Time-Based Retries in Landing

In the landing project, we've been focusing on improving the reliability of background jobs, especially when dealing with rate limiting and throttling exceptions. Previously, we used a fixed number of retry attempts, but this approach proved to be problematic.

The Problem

When jobs are released back to the queue due to rate limiting or throttling middleware, each release counted towards the

Read more
PHP CSS

Unifying Email Styling with Brand Colors in Landing Project

Introduction

The landing project is focused on creating a consistent and appealing user experience. A key aspect of this is ensuring a unified brand identity across all communication channels, including email. This post details how we standardized email styling to align with the project's brand guidelines.

The Challenge

Previously, email templates used per-template color overrides,

Read more
PHP Livewire

Serving Files Directly: Migrating from Livewire AJAX to HTTP Routes

This post details a recent optimization in the landing project, focusing on how we transitioned file downloads from a Livewire AJAX implementation to a more robust HTTP route. This change addresses issues with file corruption and improves overall reliability.

The Problem: Corrupted File Downloads

Initially, we used a Livewire method, downloadCv(), to serve dynamically generated DOCX files.

Read more

Mitigating XSS Vulnerabilities in Livewire/Alpine.js with @js()

The Problem

In the landing project, we encountered a subtle but significant security issue related to how data was being passed from PHP to JavaScript within our Blade templates. Specifically, when using Livewire and Alpine.js, values containing special characters (like apostrophes in names such as "O'Brien") could break the JavaScript context, leading to unexpected behavior or, worse,

Read more