Latest Updates

Documenting code, one commit at a time.

PHP feat 10 posts
×

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

Enhancing Database Interactions in Reimpact Platform with Notifications and Error Handling

The Reimpact platform is focused on streamlining various business processes. Recent updates enhance the platform's interaction with databases, specifically focusing on user notifications and improved error handling for foreign key violations in both MySQL and PostgreSQL.

Database Notifications

A key improvement involves enabling database notifications within Filament panels.

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