Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
@nhalstead
nhalstead / singleDB_multiTenancy_in_Laravel.php
Created December 29, 2025 07:50 — forked from isocroft/singleDB_multiTenancy_in_Laravel.php
How to properly setup tenant scoping for routes and models (by centralizing the logic for scoping) in Laravel v11.x+, v12.x+ and v13.x+
<?php
namespace Parlie\Traits\Routing\Middleware\Guard;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
trait ApplyTenantRouteGuard {