# xco-agency/laravel-saas-starter architecture

> Architecture diagram of the GitHub repository xco-agency/laravel-saas-starter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xco-agency/laravel-saas-starter
- Repository: https://github.com/xco-agency/laravel-saas-starter

## Overview

Laravel SaaS starter: a user registers, creates or joins a workspace, invites teammates, and operates within workspace roles and permissions; workspace subscriptions are billed through Stripe. The application also provides account security, administration, collaboration, APIs, webhooks, and operational features. The graph follows documented product capabilities and the sampled registration, workspace, event, and frontend evidence. Many controllers and routes were not sampled, so their internal call relationships are not asserted.

Main entry points: [`app/Models/Workspace.php`](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/Workspace.php) (Workspaces), [`app/Providers/FortifyServiceProvider.php`](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Providers/FortifyServiceProvider.php) (Authentication), [`app/Http/Controllers/TeamController.php`](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/TeamController.php) (Team management), [`app/Services/WorkspaceService.php`](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Services/WorkspaceService.php) (Workspace lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and security"]
  node_user[("User accounts<br/>[User.php]")]
  node_auth["Authentication"]
  node_connected[("Connected accounts")]
  node_login_activity[("Login activity<br/>[LoginActivity.php]")]
end

subgraph group_workspace["Workspace operations"]
  node_workspace_service["Workspace lifecycle"]
  node_workspace[("Workspaces<br/>[Workspace.php]")]
  node_team["Team management<br/>[TeamController.php]"]
  node_invitation_service["Invitation delivery"]
  node_invitation_notice["Team invitation notice"]
  node_permission_presets[("Permission presets")]
end

subgraph group_commercial["Billing and administration"]
  node_billing["Stripe billing"]
  node_admin["Admin operations"]
  node_tickets[("Support tickets<br/>[Ticket.php]")]
end

subgraph group_platform["Platform capabilities"]
  node_feature_flags[("Feature flags<br/>[FeatureFlag.php]")]
  node_audit["Audit history"]
  node_webhooks["Workspace webhooks"]
  node_webhook_endpoints[("Webhook endpoints")]
  node_webhook_logs[("Webhook logs<br/>[WebhookLog.php]")]
  node_api["Workspace API"]
end

subgraph group_client["Web application"]
  node_inertia_client["Inertia application<br/>[app.tsx]"]
end

node_customer(("SaaS user"))
node_stripe["Stripe"]

node_customer -->|"uses"| node_inertia_client
node_inertia_client -->|"registers through"| node_auth
node_auth -->|"creates account"| node_user
node_auth -->|"creates personal workspace"| node_workspace_service
node_workspace_service -->|"creates and updates"| node_workspace
node_customer -->|"manages team"| node_team
node_team -->|"delegates invitations"| node_invitation_service
node_invitation_service -->|"sends"| node_invitation_notice
node_team -->|"uses"| node_permission_presets
node_workspace -->|"has members"| node_user
node_customer -->|"manages subscription"| node_billing
node_billing -->|"processes billing"| node_stripe
node_customer -->|"administers platform"| node_admin
node_customer -->|"submits support requests"| node_tickets
node_workspace -->|"dispatches events"| node_webhooks
node_webhooks -->|"loads endpoints"| node_webhook_endpoints
node_webhook_endpoints -->|"has logs"| node_webhook_logs
node_customer -->|"uses workspace API"| node_api
node_customer -->|"uses feature-gated features"| node_feature_flags
node_workspace -->|"records activity"| node_audit
node_customer -->|"connects accounts"| node_connected
node_customer -->|"reviews login activity"| node_login_activity

click node_user "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/User.php"
click node_auth "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Providers/FortifyServiceProvider.php"
click node_connected "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/ConnectedAccount.php"
click node_login_activity "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/LoginActivity.php"
click node_workspace_service "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Services/WorkspaceService.php"
click node_workspace "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/Workspace.php"
click node_team "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/TeamController.php"
click node_invitation_service "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Services/InvitationService.php"
click node_invitation_notice "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Notifications/TeamInvitationNotification.php"
click node_permission_presets "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/PermissionPreset.php"
click node_billing "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/BillingController.php"
click node_admin "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/Admin/DashboardController.php"
click node_tickets "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/Ticket.php"
click node_feature_flags "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/FeatureFlag.php"
click node_audit "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Observers/ActivityLogObserver.php"
click node_webhooks "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Listeners/DispatchWebhooks.php"
click node_webhook_endpoints "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/WebhookEndpoint.php"
click node_webhook_logs "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/WebhookLog.php"
click node_api "https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/Api/V1/WorkspaceController.php"
click node_inertia_client "https://github.com/xco-agency/laravel-saas-starter/blob/main/resources/js/app.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_auth,node_connected,node_login_activity,node_customer toneBlue
class node_workspace_service,node_workspace,node_team,node_invitation_service,node_invitation_notice,node_permission_presets toneAmber
class node_billing,node_admin,node_tickets toneMint
class node_feature_flags,node_audit,node_webhooks,node_webhook_endpoints,node_webhook_logs,node_api toneRose
class node_inertia_client,node_stripe toneIndigo
```

## Components

### Identity and security

- [User accounts](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/User.php): `app/Models/User.php`
- [Authentication](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Providers/FortifyServiceProvider.php): `app/Providers/FortifyServiceProvider.php`
- [Connected accounts](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/ConnectedAccount.php): `app/Models/ConnectedAccount.php`
- [Login activity](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/LoginActivity.php): `app/Models/LoginActivity.php`

### Workspace operations

- [Workspace lifecycle](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Services/WorkspaceService.php): `app/Services/WorkspaceService.php`
- [Workspaces](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/Workspace.php): `app/Models/Workspace.php`
- [Team management](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/TeamController.php): `app/Http/Controllers/TeamController.php`
- [Invitation delivery](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Services/InvitationService.php): `app/Services/InvitationService.php`
- [Team invitation notice](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Notifications/TeamInvitationNotification.php): `app/Notifications/TeamInvitationNotification.php`
- [Permission presets](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/PermissionPreset.php): `app/Models/PermissionPreset.php`

### Billing and administration

- [Stripe billing](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/BillingController.php): `app/Http/Controllers/BillingController.php`
- [Admin operations](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/Admin/DashboardController.php): `app/Http/Controllers/Admin/DashboardController.php`
- [Support tickets](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/Ticket.php): `app/Models/Ticket.php`

### Platform capabilities

- [Feature flags](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/FeatureFlag.php): `app/Models/FeatureFlag.php`
- [Audit history](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Observers/ActivityLogObserver.php): `app/Observers/ActivityLogObserver.php`
- [Workspace webhooks](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Listeners/DispatchWebhooks.php): `app/Listeners/DispatchWebhooks.php`
- [Webhook endpoints](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/WebhookEndpoint.php): `app/Models/WebhookEndpoint.php`
- [Webhook logs](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Models/WebhookLog.php): `app/Models/WebhookLog.php`
- [Workspace API](https://github.com/xco-agency/laravel-saas-starter/blob/main/app/Http/Controllers/Api/V1/WorkspaceController.php): `app/Http/Controllers/Api/V1/WorkspaceController.php`

### Web application

- [Inertia application](https://github.com/xco-agency/laravel-saas-starter/blob/main/resources/js/app.tsx): `resources/js/app.tsx`

### Other components

- **SaaS user**
- **Stripe**

## Connections

- SaaS user → Inertia application: uses (evidence: `README.md`)
- Inertia application → Authentication: registers through (evidence: `README.md`)
- Authentication → User accounts: creates account
- Authentication → Workspace lifecycle: creates personal workspace
- Workspace lifecycle → Workspaces: creates and updates (evidence: `app/Services/WorkspaceService.php`)
- SaaS user → Team management: manages team (evidence: `README.md`)
- Team management → Invitation delivery: delegates invitations (evidence: `app/Http/Controllers/TeamController.php`)
- Invitation delivery → Team invitation notice: sends (evidence: `app/Services/InvitationService.php`)
- Team management → Permission presets: uses (evidence: `app/Http/Controllers/TeamController.php`)
- Workspaces → User accounts: has members (evidence: `app/Models/Workspace.php`)
- SaaS user → Stripe billing: manages subscription (evidence: `README.md`)
- Stripe billing → Stripe: processes billing (evidence: `README.md`)
- SaaS user → Admin operations: administers platform (evidence: `README.md`)
- SaaS user → Support tickets: submits support requests (evidence: `README.md`)
- Workspaces → Workspace webhooks: dispatches events (evidence: `app/Providers/AppServiceProvider.php`)
- Workspace webhooks → Webhook endpoints: loads endpoints (evidence: `app/Listeners/DispatchWebhooks.php`)
- Webhook endpoints → Webhook logs: has logs (evidence: `app/Models/WebhookEndpoint.php`)
- SaaS user → Workspace API: uses workspace API (evidence: `README.md`)
- SaaS user → Feature flags: uses feature-gated features (evidence: `README.md`)
- Workspaces → Audit history: records activity (evidence: `app/Providers/AppServiceProvider.php`)
- SaaS user → Connected accounts: connects accounts (evidence: `README.md`)
- SaaS user → Login activity: reviews login activity (evidence: `README.md`)
