Latest Updates

Documenting code, one commit at a time.

Chat PHP 10 posts
×
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

Read more

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

Read more

Tenant Isolation Strategy: Global Rates in a Multi-Tenant Laravel Application

Introduction

In multi-tenant applications, data isolation is key. One common challenge is determining which data should be tenant-specific and which should be global. In our Laravel platform project, we faced this question with application rates. Initially, we considered rates to be tenant-scoped, but we discovered that, due to regulatory requirements, these rates are actually global and

Read more
PHP Laravel

Tackling QueryExceptions: Ensuring Data Integrity in Laravel Applications

When developing applications with Laravel, maintaining database schema consistency across different environments is crucial. In the Reimpact/platform project, a recent issue highlighted the importance of this practice. The project involves managing various data points, and a discrepancy arose when a column present in one database schema was missing in another.

The Problem: Missing Column

Read more
PHP Filament

Filament v5: Addressing Class Not Found Errors with Layout Components

Introduction

When upgrading to new versions of frameworks, you sometimes encounter unexpected errors. This post addresses a "class not found" error in Filament v5 related to relocated layout components, and how to resolve it.

The Issue: Layout Components Relocation

In Filament v5, layout components like Section and Grid were moved from Filament\Forms\Components to

Read more

Enhancements to Rate Management in the Platform

Streamlining Rate Management in the Platform

We've been working on the Reimpact platform to improve how rates are managed, focusing on global applicability and enhanced security. Here's a breakdown of the changes.

Global Rate Application

Previously, rates were tied to specific companies. We've transitioned to a model where rates are global, scoped by a priority_product_id.

Read more
PHP MySQL

Seeding Initial Data in Reimpact Platform

Introduction

When bootstrapping a new environment for the Reimpact platform, it's often necessary to populate the database with initial data. This post details how we approached seeding rate data from a production MySQL dump into a new PostgreSQL instance, focusing on an idempotent migration strategy.

The Challenge

We needed to migrate 448 rows of rate data from an existing MySQL

Read more
PHP Laravel

Fixing Dashboard Errors: A Lesson in Database Consistency

This post details a recent fix in the Reimpact/platform project, focusing on database consistency and its impact on user experience.

The Problem

Users of the v2 packaging dashboard were encountering 500 errors when interacting with certain widgets. Initial investigation pointed to a missing database table, public.rates.

Read more
PHP Laravel

Fixing Tenant Scoping with TenantAwareBuilder in Laravel

The Problem

In multi-tenant Laravel applications built with Filament, scoping data to the current tenant is crucial. We encountered an issue where Filament's multi-tenancy implementation, using whereIn() for tenant scoping, failed when applied to tenant schema tables lacking a company_id column. This resulted in "column 'company_id' does not exist" errors across Filament resources.

Read more