Latest Updates

Documenting code, one commit at a time.

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

Handling Livewire Requests with Laravel Middleware

The Problem

In a Laravel application, particularly when using Livewire, maintaining consistent authentication behavior across different types of requests can be tricky. A common issue arises when Livewire requests, which often send Content-Type: application/json, are not correctly handled by authentication middleware, leading to unexpected 401 errors instead of redirects to the login page.

Read more
PHP Laravel

Streamlining Module Access in Reimpact Platform

The Reimpact platform aims to provide a robust foundation with customizable features for various user roles. A recent enhancement focuses on simplifying and automating module access assignments.

The Challenge: Manual Permission Management

Previously, managing module access for different user types involved manual configuration, which could be time-consuming and prone to errors.

Read more

Enhanced Error Logging for Laravel Authentication

Introduction

In the Reimpact/platform project, diagnosing login issues can be challenging, especially when users encounter authentication errors. To streamline this process, we've implemented more detailed logging for HTTP exceptions related to authentication failures (401 Unauthorized, 403 Forbidden).

The Problem

Previously, when a user failed to authenticate, the logs provided limited

Read more

Troubleshooting 401 Errors After Login in Laravel Applications

Introduction

Experiencing a 401 Unauthorized error immediately after a successful login can be a frustrating issue in Laravel applications. This often stems from incorrect redirection targets or misconfigured middleware. Let's explore how to diagnose and resolve such problems, specifically within the context of projects using middleware for access control.

Understanding the Problem

Read more

Debugging Authentication Issues in Laravel Filament

Introduction

When developing with Laravel and Filament, encountering authentication issues can be a common challenge. Diagnosing these issues, especially vague 401 errors, requires a strategic approach to uncover the root cause. This post outlines a method for adding detailed logging to your authentication process to better understand and resolve such errors.

The Problem: Elusive 401

Read more
PHP JavaScript

Improving Context Management in Breniapp Chat Iterations

The Breniapp project focuses on enhancing user interaction and content generation. A recent update addresses context pollution during chat iterations, streamlining the process and improving debug capabilities for administrators.

The Problem: Context Accumulation

Previously, the chat iteration process (handleIterateSubmitDirect) appended modifications directly to the existing context.

Read more
JavaScript PHP

Fixing a Scoped JavaScript Issue in Breniapp/brenia

The Breniapp/brenia project encountered an issue where a JavaScript library, html2canvas, was not properly loaded on a specific page, leading to undefined behavior. Here's how the problem was identified and resolved.

The Problem

The html2canvas library, intended for use on the content-generation page within the Filament admin panel, was failing to load.

Read more
PHP JavaScript

Enhancing Image Editing Workflow in Breniapp/brenia

Introduction

In the Breniapp/brenia project, a recent enhancement focuses on improving the image editing workflow after initial image generation. This involves ensuring that events triggered during the generation process are properly handled to enable seamless editing capabilities.

The Problem

Previously, after an image was generated using the GenerateEditorPanel, an iterate-layer

Read more