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.