@Entity
@Table(name = "invoices")
@FilterDef(
name = "tenantFilter",
parameters = @ParamDef(name = "tenantId", type = String.class)
)
import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common';
import { Request, Response, NextFunction } from 'express';
import { TenantService } from './tenant.service';
@Injectable()
export class TenantContextMiddleware implements NestMiddleware {
class TenantResolver
RESERVED = %w[www app admin].freeze
def initialize(app)
@app = app
end
<?php
namespace App\Tenancy;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;