Latest Updates

Documenting code, one commit at a time.

PHP JavaScript

Preserving Element Dimensions with Alpine.js Bindings

When working with dynamic styling in Alpine.js, it's crucial to understand how attribute bindings interact with existing styles. A common pitfall is unintentionally overwriting existing style attributes when only intending to modify a specific style property.

The Problem: Overwriting Styles

The issue arises when using the :style binding in Alpine.js. If the expression bound to :style

Read more
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.

Read more
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.

Read more
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

Read more

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

Read more
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

Read more
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

Read more