Latest Updates

Documenting code, one commit at a time.

PHP PostgreSQL

Graceful Handling of PostgreSQL Privileges in Platform Setup

Introduction

When deploying the Reimpact platform, ensuring a smooth setup process across different environments is crucial. This post addresses a common issue encountered during tenant schema population, specifically when the executing user lacks PostgreSQL superuser privileges. We'll explore the problem and how a simple try-catch block resolves it, enhancing the platform's robustness.

Read more

Enhancing Tenant Schema Population in Laravel

Introduction

When building multi-tenant applications with Laravel, managing database schemas for each tenant can become complex. We recently improved our tenant schema population process in the platform project to handle various edge cases and ensure data integrity across companies.

The Problem

Our initial schema population process had several limitations:

  1. PostgreSQL's
Read more

Multi-Tenancy in Laravel with PostgreSQL Schemas: A Migration Story

Introduction

Row-level filtering is common for multi-tenancy, but what if you need stronger isolation? At Reimpact's platform, we're migrating towards PostgreSQL schemas to achieve true tenant separation, leveraging Laravel, Filament, and the middleware pattern.

This post details our approach to dynamically setting the PostgreSQL search_path for each tenant, ensuring data isolation and

Read more

Multi-Tenancy with PostgreSQL Schemas in Laravel

Introduction

When building multi-tenant applications, choosing the right architecture is critical. This post explores how to leverage PostgreSQL schemas within a Laravel application to achieve tenant isolation, enhance security, and improve scalability.

The Multi-Tenant Challenge

Traditional multi-tenant approaches often involve sharing a single database and distinguishing tenants by a

Read more
PHP PostgreSQL

PostgreSQL Case Sensitivity and Dashboard Calculations in Reimpact Platform

Introduction

When developing dashboards that rely on precise data comparisons in PostgreSQL, case sensitivity can be a silent but critical issue. This post examines a case in the Reimpact platform where case sensitivity in unit comparisons caused dashboard calculations to return incorrect results, and how it was resolved.

The Problem: Case-Sensitive Comparisons

PostgreSQL, by default,

Read more

PostgreSQL Type Casting for Data Consistency in Laravel

When developing applications using Laravel with a PostgreSQL database, maintaining strict data type consistency is crucial, especially when dealing with dashboard functionalities that aggregate data. PostgreSQL's strong type checking can lead to unexpected errors if data types don't match exactly between the database schema and the application's expectations.

The Problem: Type Mismatches

Read more

Refining Filament Page Layout for Enhanced User Experience

Introduction

In the Breniapp/brenia project, we're continuously working to improve the user interface and overall user experience. One recent focus has been on optimizing the layout of Filament admin panel pages, particularly in scenarios where a more compact design is desired.

The Challenge: Vertical Space Optimization

Filament, a PHP-based admin panel, offers a flexible and

Read more

Database Compatibility: Adapting Queries for PostgreSQL

When developing applications across different database systems, ensuring compatibility in your queries is crucial. Minor differences in SQL syntax can lead to unexpected errors and application downtime. Let's explore a practical example of adapting queries for PostgreSQL.

The Challenge: Date Extraction

MySQL provides functions like YEAR() and MONTH() to extract year and month values from

Read more