Latest Updates

Documenting code, one commit at a time.

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

Enhancing Data Visualization in Filament with PostgreSQL Functions

Introduction

This post explores how the Reimpact/platform project enhanced its Filament-based dashboard by leveraging PostgreSQL functions to improve data visualization. The focus was on creating a more insightful and efficient packaging dashboard.

From MySQL to PostgreSQL: A Performance Shift

The initial implementation relied on MySQL stored procedures. To optimize performance and

Read more
PHP Livewire

Maintaining Session Integrity During Impersonation in Livewire

Introduction

When implementing user impersonation functionality, a common pitfall is inadvertently breaking the user's session. This post addresses an issue in a Reimpact platform where session loss occurred during impersonation due to Livewire's single-page application (SPA) navigation.

The Problem: Session Regeneration and SPA Navigation

The Auth::login() function in PHP regenerates

Read more

Enhancing User Experience with Filament Impersonation

Introduction

The Reimpact platform is undergoing improvements to enhance user experience and administrative capabilities. A key feature recently added is the ability for administrators to impersonate users, streamlining support and testing processes. This post will explore the implementation of Filament impersonation and associated fixes.

The Problem

Previously, the platform relied on a

Read more
PHP Filament

Refactoring Filament Actions: Namespace Updates

When working with the Reimpact/platform project, keeping dependencies up-to-date is crucial for stability and leveraging the latest features. This post details a recent refactor addressing namespace changes in the Filament framework, specifically concerning Actions.

The Challenge: Filament v5 Namespace Changes

Filament, like many actively developed frameworks, undergoes periodic updates that

Read more