Latest Updates

Documenting code, one commit at a time.

PHP 10 posts
×
0 PHP

Tenant Isolation: Querying Data Directly

When building multi-tenant applications, data isolation is crucial. A common approach is to use separate database schemas for each tenant. However, this can introduce complexity when querying data, especially when dealing with relationships between tables.

The Problem: Relationships in Tenant Schemas

In a multi-tenant application, each tenant's data resides in its own schema.

Refactoring Rates: From Foreign Keys to Enums in Reimpact Platform

In the Reimpact platform, we're constantly striving for a cleaner, more maintainable codebase. Recently, we tackled an area involving rates and their association with different modules within the system.

The Problem: Priority Products and Foreign Keys

Originally, rates were tied to "priority products" using a foreign key relationship. This approach, while seemingly straightforward,

0 PHP Platform

Tenant Scoping Adjustments in Platform Rates

Introduction

The Reimpact platform involves managing various resources, including rate configurations. Recent updates address how these rates are scoped within a multi-tenant environment.

The Issue

Previously, the platform attempted to scope rate resources to a specific tenant (company) using a relationship that no longer existed. This caused errors and prevented proper rate management.

0 PHP Filament

Fixing Late Static Binding Issues in Filament Resources

When developing with Filament, you might encounter issues with PHP's late static binding, especially when working with resources. A recent update to the platform project addressed such a problem, improving the way queries are handled within resource classes.

The issue arose from directly calling Resource::getEloquentQuery(). This approach breaks PHP's late static binding, causing

Refactoring Primary Keys with Foreign Key Constraints in Reimpact Platform

When refactoring database schemas, developers often encounter challenges with primary and foreign key relationships. In the Reimpact platform, a recent update focused on modifying a primary key (priority_product ID) while ensuring existing foreign key references remained valid. This process highlights the importance of managing dependencies during schema alterations.

The Problem

0 PHP Laravel

Handling Database Seed Conflicts in Laravel

Introduction

When working on the Reimpact platform, a common issue arises during database seeding: conflicting UUIDs, especially when dealing with priority products. This post details how to resolve such conflicts, ensuring smooth database setup and consistent application behavior.

The Problem: Duplicate Entries

During the database seeding process, the system attempts to insert a new

0 PHP

Enhancing Data Integrity with Domain Layer Validation in Filament Resources

Introduction

Ensuring data integrity is paramount for any robust application. In the Reimpact/platform, we're focusing on strengthening our Filament resources by implementing domain layer validation. This approach ensures that data adheres to business rules right at the entry point, leading to fewer errors and a more consistent data model.

The Need for Domain Layer Validation

0 PHP Laravel

Seeding Sanity: Ensuring Data Integrity in Laravel Migrations

When working on the Reimpact/platform, we encountered an issue where seeding migrations were failing due to missing prerequisite data. This post outlines the problem and the solution implemented to ensure data integrity during migrations.

The Problem

Our Laravel application relies on a seeding process to populate the database with initial data. One particular migration was attempting to

Ensuring Data Integrity: A Migration Story

Imagine deploying a new feature only to find that a critical piece of data is missing, causing unexpected errors. This is the story of how a small, seemingly insignificant migration change prevented a larger issue in a Laravel project called platform.

The Problem

During a recent update, it was discovered that a database row, specifically the priority_product entry, was not consistently