Team Management
esimtida's team architecture allows your users to collaborate efficiently within isolated workspaces.
Team Isolation
When a user signs up, a personal `Team` is automatically provisioned for them. All resources (Projects, API Keys) are attached to this Team. Users can invite others to their Team, granting them access to their active Projects.
Context Controller
esimtida provides an advanced `ContextController`. This mechanism allows a user to "Switch Context" (switch active Project or active Team). When the context changes, the session is updated, and all subsequent database queries are scoped to the selected Context seamlessly.
Global Scope Example
// Inside a Model (e.g., Project.php)
protected static function booted()
{
static::addGlobalScope('team', function (Builder $builder) {
if (auth()->check()) {
$builder->where('team_id', auth()->user()->currentTeam->id);
}
});
}
protected static function booted()
{
static::addGlobalScope('team', function (Builder $builder) {
if (auth()->check()) {
$builder->where('team_id', auth()->user()->currentTeam->id);
}
});
}