feat: multi-tenant SaaS implementation - admin interface, tenant isolation, and UI updates

This commit is contained in:
jeremy bayse
2026-03-28 18:38:22 +01:00
parent 7d94be7a8c
commit f53d5770df
20 changed files with 757 additions and 34 deletions

View File

@@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
#[Fillable(['name', 'email', 'password', 'role'])]
#[Fillable(['name', 'email', 'password', 'role', 'tenant_id'])]
#[Hidden(['password', 'remember_token'])]
class User extends Authenticatable
{
@@ -19,7 +19,12 @@ class User extends Authenticatable
public function isAdmin(): bool
{
return $this->role === 'admin';
return in_array($this->role, ['admin', 'super_admin']);
}
public function isSuperAdmin(): bool
{
return $this->role === 'super_admin';
}
public function isCandidate(): bool
@@ -32,6 +37,11 @@ class User extends Authenticatable
return $this->hasOne(Candidate::class);
}
public function tenant()
{
return $this->belongsTo(Tenant::class);
}
/**
* Get the attributes that should be cast.
*