WorkspaceScope existed as a standalone Scope class but was never registered as a global scope via BelongsToWorkspace. This meant queries like Account::query()->get() would not be automatically filtered by workspace, and the forWorkspace()/acrossWorkspaces() macros (which call withoutGlobalScope) had no effect. Changes: - Add static::addGlobalScope(new WorkspaceScope) in bootBelongsToWorkspace() - Delegate getCurrentWorkspace() to Workspace::current() (DRY) - Update scopeOwnedByCurrentWorkspace() to use Workspace::current() - Update ownedByCurrentWorkspaceCached() to use Workspace::current() - Document architecture relationship between the two classes Fixes #5 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| WorkspaceScope.php | ||