Basic tenant structure

This commit is contained in:
2026-01-31 20:07:41 +01:00
parent 825af15962
commit 3570f442f5
35 changed files with 634 additions and 144 deletions

14
app/Scopes/SiteScope.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
namespace App\Scopes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
class SiteScope implements Scope
{
public function apply(Builder $builder, Model $model): void
{
$builder->where($model->getTable() . '.tenant', app('tenant')->slug);
}
}