Latest Updates

Documenting code, one commit at a time.

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

Enhancing Filament Resource Testing with Pest and Tenant Awareness

Introduction

The Reimpact/platform project is undergoing improvements to its testing infrastructure, specifically focusing on Filament resources. The goal is to ensure comprehensive test coverage for CRUD operations across various resources, while also addressing tenant-specific data handling.

The Challenge

Previously, testing Filament resources lacked sufficient coverage, especially

Read more
PHP Laravel

Tenant Schema Migration in Reimpact Platform

The Reimpact platform is undergoing significant architectural changes to better support multi-tenancy. This post details recent efforts to fully migrate to a tenant-based schema, enhancing data isolation and scalability.

Completing the Tenant Migration

The focus has been on ensuring that all relevant models and database tables are correctly associated with the tenant schema.

Read more

Tenant Schema Optimization in Reimpact Platform's Packaging Module

The Reimpact platform is undergoing continuous improvements to enhance its multi-tenancy capabilities. Recent work focuses on optimizing database queries within the Packaging module, ensuring data isolation and preventing errors in tenant-specific schemas.

The Problem

In a multi-tenant environment, each tenant operates within its own schema. The Packaging module, responsible for managing

Read more

Simplifying Tenant Management in Reimpact Platform

The Challenge

In multi-tenant applications, managing data isolation is crucial. The Reimpact platform, designed for managing various industrial processes, initially relied on company_id filtering within each database table to achieve this isolation. This approach, while functional, introduced redundancy and complexity across our Eloquent models.

The Solution: PostgreSQL Schema Isolation

Read more
PHP Laravel

Tenant Migrations and the Perils of Implicit State

The Reimpact/platform project involves managing multi-tenant applications. One subtle issue arose related to running migrations within these tenants. The original approach, while seemingly straightforward, introduced an unexpected dependency on implicit state, leading to incorrect migration behavior.

The Problem

Initially, tenant migrations were executed using Laravel's

Read more