How adlidums/helpdesk-saas works
This is a small Laravel application skeleton with a tenant-resolution example, not the Laravel framework itself. Its main workflow routes a tenant subdomain request through middleware, looks up the tenant by slug, places it in request-scoped context, and returns the tenant name as JSON. A separate central-domain route renders the welcome page. Tenant and user models define their association, and a seeder creates sample tenants and owners. The graph follows the sampled routes and application code; database behavior is represented only where an explicit query or model operation is shown.
Main entry points: web.php Web routes · ResolveTenant.php Tenant resolver · Tenant.php Tenant model · TenantSeeder.php Tenant seeder
Components 10
Request handling
- Web routes
routes/web.php - Tenant resolver
app/Http/Middleware/ResolveTenant.php - Welcome page
resources/views/welcome.blade.php
Tenant domain
- Tenant context
app/TenantContext.php - Tenant model
app/Models/Tenant.php - User model
app/Models/User.php - Tenant seeder
database/seeders/TenantSeeder.php - Application database
Application setup
- Service provider
app/Providers/AppServiceProvider.php
Other components
- Web visitor
Connections 13
- Web visitor → Web routes: requests
- Web routes → Tenant resolver: routes through
routes/web.php - Tenant resolver → Tenant model: looks up
app/Http/Middleware/ResolveTenant.php - Tenant resolver → Application database: queries
app/Http/Middleware/ResolveTenant.php - Tenant resolver → Tenant context: sets and clears
app/Http/Middleware/ResolveTenant.php - Web routes → Tenant context: reads tenant
routes/web.php - Web routes → Welcome page: renders
routes/web.php - Service provider → Tenant context: registers scoped
app/Providers/AppServiceProvider.php - Tenant model → User model: has many
app/Models/Tenant.php - User model → Tenant model: belongs to
app/Models/User.php - Tenant seeder → Tenant model: creates tenants
database/seeders/TenantSeeder.php - Tenant seeder → User model: creates owners
database/seeders/TenantSeeder.php - Tenant seeder → Application database: writes records
database/seeders/TenantSeeder.php