Latest Updates

Documenting code, one commit at a time.

Ensuring Data Integrity: Restoring Global Rates in a Laravel Application

Introduction

Maintaining data accuracy across all tenants in a multi-tenant application can be challenging. This post explores how to correct an issue where global rates were inadvertently made tenant-specific in a Laravel application, impacting data integrity.

The Problem: Tenant-Scoped Rates

Originally, the rates table was intended to store global rates applicable to all tenants.

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

Handling Large Uploads and Improving Error Notifications in a Filament Application

When working with the Reimpact/platform project, we encountered an issue with large upload deletions that resulted in failures and an unhelpful JSON response. This post describes how we resolved the deletion failure and improved the user experience by displaying a Filament notification instead of a raw JSON page.

The Problem

Deleting a large number of generated reports and calculated data

Read more

Handling Tenant Database Schema Updates in Laravel

When developing multi-tenant applications with Laravel, managing database schema updates across tenants can be tricky. This post discusses how to address a common issue: ensuring that all tenant databases have the necessary schema changes after migrations.

The Problem: Missing Columns After Migration

In a multi-tenant Laravel application, each tenant typically has its own database schema.

Read more
PHP Laravel

Enhancing Tenant Isolation in Laravel Queues

Introduction

In multi-tenant applications, ensuring data isolation between tenants is paramount. We encountered an issue in our Reimpact/platform project where queue jobs and dashboard caching mechanisms weren't properly respecting the tenant context, leading to errors and potential data leakage.

The Problem: Missing Tenant Context

Two key areas were affected:

  1. Queue Jobs:
Read more

Evolving Data Structures in Platform Notifications

The platform project is undergoing continuous improvement to enhance its notification system.

The Challenge: Data Structure Evolution

Initially, the notification system stored data in a simple text column. However, as the platform evolved, the need for richer, structured data within notifications became apparent. This required a transition to a more flexible data type.

The Solution:

Read more
PHP Laravel

Ensuring UUID Compatibility in Laravel Notifications

The Problem

In the Reimpact/platform project, we encountered an issue with how user IDs were handled in the notifications system. Specifically, the notifiable_id column in the notifications table was initially defined as a bigint. This caused problems when we started using UUIDs (Universally Unique Identifiers) for user IDs, particularly with PostgreSQL, as bigint columns cannot store

Read more
Laravel PHP

Streamlining Laravel Migrations: Removing Duplicates for Stability

When maintaining a Laravel application like Reimpact/platform, ensuring database migrations are clean and consistent is crucial for smooth deployments and upgrades. Duplicate migrations can lead to frustrating errors, especially in versioned environments.

The Problem: Duplicate Migrations

Imagine deploying a new version of your application only to encounter a "table already exists" error

Read more
PHP Laravel

Enhancing Data Flexibility in Reimpact/platform Notifications

This post discusses a recent enhancement to the Reimpact/platform project, focusing on improving the flexibility and querying capabilities of notification data.

The Challenge

Previously, notification data was stored in a less flexible format, making it difficult to perform complex queries or adapt to evolving data structures. To address this, a decision was made to migrate the notification

Read more
PHP Laravel

Streamlining Filament Database Notifications in Reimpact/platform

Reimpact/platform is undergoing enhancements to improve its notification system. A recent update focuses on integrating Filament database notifications more effectively.

The Enhancement

This update introduces a migration for the notifications table, specifically tailored for Filament database notifications. This ensures that the application is equipped to handle and store notifications

Read more