Latest Updates

Documenting code, one commit at a time.

Solving Livewire Rendering Glitches with wire:key and PHP Styling in Breniapp

This post discusses how we addressed a rendering issue in the Breniapp project related to dynamically updating canvas aspect ratios. The problem stemmed from using Alpine.js to manage the aspect ratio of a canvas element within a Blade template that conditionally rendered based on Livewire state.

The Problem

Initially, Alpine.js was used to dynamically update the aspect ratio of a canvas

Read more
PHP Filament

Stabilizing Filament Integration in Platform Projects

Introduction

When integrating libraries like Filament into larger platform projects, version incompatibilities can cause widespread issues. A recent update to the Reimpact/platform project highlighted how crucial it is to maintain API compatibility to prevent application crashes.

The Problem: API Version Mismatch

The Ecodesign module within the platform project was developed against a

Read more

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

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

Targeted Campaigns: Country-Based Filtering

The devlog-ist/landing project focuses on creating effective landing pages and user onboarding flows. A recent feature addition enables country-specific targeting for email campaigns, leveraging country detection during user onboarding to improve campaign relevance.

The Problem

Previously, email campaigns were broadcast to all users, regardless of their location.

Read more
PHP Filament

Balancing Filament Versions in Platform Development

When developing a platform like Reimpact's, managing dependencies across different environments can become a challenge, especially when using frameworks like Filament. This post explores how to handle version mismatches gracefully during development and deployment.

The Problem: Version Conflicts

Imagine a scenario where your production environment relies on an older version of a framework (e.

Read more

Improving Feedback Form Accuracy in Landing Pages

Introduction

In web development, capturing accurate context is crucial for debugging and improving user experience. This post addresses an issue encountered in the devlog-ist/landing project where the feedback form was capturing an incorrect URL due to server-side rendering limitations with Livewire.

The Problem: Server-Side URL Capture

When using Livewire, attempting to capture the

Read more