Latest Updates

Documenting code, one commit at a time.

Improving Application Stability and User Experience in Landing

The devlog-ist/landing project focuses on creating a smooth and reliable user experience. Recent work has addressed several critical production errors to enhance stability and prevent disruptions.

Addressing Production Errors

Production errors can significantly impact user satisfaction and overall application performance. A proactive approach to identifying and resolving these issues is

Read more

Multi-Tenancy in Laravel with PostgreSQL Schemas: A Migration Story

Introduction

Row-level filtering is common for multi-tenancy, but what if you need stronger isolation? At Reimpact's platform, we're migrating towards PostgreSQL schemas to achieve true tenant separation, leveraging Laravel, Filament, and the middleware pattern.

This post details our approach to dynamically setting the PostgreSQL search_path for each tenant, ensuring data isolation and

Read more

Skipping Session Validation Middleware During Impersonation in Platform

The Problem

In the Reimpact platform, we encountered an issue where session validation middleware was causing unexpected logouts during user impersonation. Specifically, the CheckValidSession and EnsureSingleSession middlewares were interfering with the impersonation process, leading to a frustrating user experience.

The Cause

The root cause of the problem lies in how the session is

Read more

Streamlining Onboarding with Middleware Bypass Logic

Introduction

Imagine a scenario where specific user roles within an application are needlessly subjected to onboarding processes designed for different user groups. This post explores how to selectively bypass middleware to optimize the user experience for marketing admins in the 'landing' project.

The Problem: Unnecessary Onboarding Steps

In many applications, middleware is used to

Read more

Validating Livewire Requests with Middleware in the Platform Project

In the Reimpact/platform project, a recent update addresses an issue where Livewire update requests were being incorrectly blocked by a custom middleware. This post details the problem and the solution implemented.

The Problem

The ValidationUserMiddleware was designed to handle user authentication and validation for incoming requests. However, it was inadvertently blocking unauthenticated

Read more

Handling Livewire Requests with Laravel Middleware

The Problem

In a Laravel application, particularly when using Livewire, maintaining consistent authentication behavior across different types of requests can be tricky. A common issue arises when Livewire requests, which often send Content-Type: application/json, are not correctly handled by authentication middleware, leading to unexpected 401 errors instead of redirects to the login page.

Read more

Troubleshooting 401 Errors After Login in Laravel Applications

Introduction

Experiencing a 401 Unauthorized error immediately after a successful login can be a frustrating issue in Laravel applications. This often stems from incorrect redirection targets or misconfigured middleware. Let's explore how to diagnose and resolve such problems, specifically within the context of projects using middleware for access control.

Understanding the Problem

Read more

Tenant Context Troubles: Debugging Queue Deserialization in a Multi-Tenant Laravel App

In the Reimpact/platform project, we encountered a tricky issue with queue deserialization in our multi-tenant environment. This post details the problem, our investigation, and the solution we implemented.

The Problem

Our application uses a queue to generate reports. A GenerateReportJob is dispatched, serializing the GeneratedReport model.

Read more

Tenant Schema Resetting Too Early: A Laravel Livewire Gotcha

The Reimpact/platform project focuses on providing a multi-tenant application structure. Recently, we encountered an issue with tenant database schemas being reset prematurely during Livewire updates. This post dives into the problem and the solution implemented.

The Problem

In a multi-tenant application, each tenant typically has its own database schema. We use middleware to set the correct

Read more