inmanturbo/enterprise
Composer 安装命令:
composer create-project inmanturbo/enterprise
包简介
Enterprise Starter Kit for laravel.
关键字:
README 文档
README
inmanturbo/enterprise
An enterprise-grade Laravel starter kit with event sourcing and organization-based multi-tenancy.
Installation
Laravel Herd
Laravel Installer
laravel new enterprise --using=inmanturbo/enterprise
Post-Install
php artisan migrate --database=landlord --path=database/migrations/landlord php artisan db:seed composer run dev
Default Accounts
After seeding, these accounts are available:
| Password | Role | |
|---|---|---|
| admin@example.com | password | Site Admin |
| jane@example.com | password | Member |
| bob@example.com | password | Member |
All users belong to the default organization Acme Corp (domain: enterprise.test).
What's Included
- Event-sourced writes via aggregate roots (User, Organization)
- Organization-based multi-tenancy with per-org tenant databases
- Auto-provisioning of tenant databases on organization creation
- Fortify authentication — login, registration, password reset, email verification, two-factor authentication
- Admin panel for managing organizations and users
- Organization management — member management, role assignment, settings
- Tenant-scoped media library infrastructure (ready for your domain models)
- Registration modes — open (public) or invite-only
- Dark mode, responsive design, organization switcher
Architecture
Event Sourcing
All writes flow through aggregate roots. Aggregates validate business rules, record domain events, and persist them to an event store. Projectors listen to those events and update read models (Eloquent tables). There is no command bus — aggregates are called directly from controllers and Livewire components.
Aggregates: UserAggregate, OrganizationAggregate
Projectors: UserProjector, OrganizationProjector, OrganizationUserProjector, TenantDatabaseProjector
Events: 19 domain events in app/StoredEvents/Landlord/ covering user lifecycle, organization management, role assignment, and tenant database provisioning.
Dual Event Stores
- Landlord — stores all platform-level events (users, organizations, tenant provisioning)
- Tenant — each tenant database includes its own
stored_eventsandsnapshotstables for tenant-scoped event sourcing
Multi-Tenancy
The platform uses a landlord/tenant database split powered by Spatie Laravel Multitenancy:
- Landlord database — users, organizations, organization memberships, tenant database records, platform event store
- Tenant databases — one per organization, auto-provisioned on creation, containing tenant-scoped data (event store, snapshots, media)
Tenant resolution is two-phase:
- Domain-based —
TenantFindermatches the request hostname against organization domains - User-based — when no domain match, the authenticated user's
current_organization_iddetermines the active tenant
Registration Modes
Configured via the ENTERPRISE_REGISTRATION_MODE environment variable in config/enterprise.php:
| Mode | Behavior |
|---|---|
open (default) |
Public registration enabled. Each new user gets an auto-created organization and tenant database. |
invite |
Registration disabled. Site admins create users and assign them to organizations. |
Roles & Permissions
Authorization is enforced across four tiers:
| Role | Scope | Capabilities |
|---|---|---|
| Site Admin | Platform-wide | Full access to admin panel. Manage all organizations and users. Can act as org owner in any organization. |
| Org Owner | Single organization | Edit org settings, manage members (invite, change roles, activate/deactivate, remove). Cannot be removed from the organization. |
| Org Admin | Single organization | admin role on the pivot. Currently equivalent to member (reserved for future granular permissions). |
| Org Member | Single organization | member role on the pivot. Access to the organization's tenant-scoped features. |
Site admin status is stored on the users.is_admin column. Org roles (admin, member) are stored on the organization_user pivot via the Role enum.
Admin Panel
Available at /admin/ (requires site admin):
- Organizations (
/admin/organizations) — list, create, edit organizations. Search by name/domain. Activate/deactivate organizations. - Users (
/admin/users) — list, create, edit users. Search by name/email. Filter by organization. Activate/deactivate users. Set admin status.
Organization Management
Available to org owners and site admins:
- Settings (
/organization/settings) — edit organization name - Members (
/organization/members) — search members, change roles, activate/deactivate, remove members, invite new members - Org Switcher — sidebar dropdown to switch between organizations the user belongs to
Media Library
Tenant-scoped file storage infrastructure powered by Spatie Media Library:
- Private originals — stored at
storage/app/private/tenants/{id}/media - Public conversions — stored at
storage/app/public/tenants/{id}/media - Authenticated file serving — private media served via
GET /media/{media}(requires auth + active tenant) - Infrastructure-only — no models implement
HasMediayet. The media table, disk configuration, and serving route are in place, ready for your domain models.
Database Architecture
Landlord Tables
users, organizations, organization_user, tenant_databases, stored_events, snapshots, cache, jobs, job_batches, failed_jobs, sessions, password_reset_tokens
Tenant Tables
stored_events, snapshots, media
Migration Paths
- Landlord:
database/migrations/landlord/ - Tenant:
database/migrations/
Tenant databases support mixed drivers — each organization's tenant database can use sqlite, mysql, mariadb, or pgsql independently.
Deployment
php artisan deploy
This runs landlord migrations followed by tenant migrations across all organizations.
Development
composer run dev # Runs server, queue listener, log tail (Pail), and Vite concurrently composer run lint # Laravel Pint code formatting composer run test # Pest test suite
Testing
Tests use Pest 4 with SQLite for both landlord and tenant database connections (configured in phpunit.xml). Landlord migrations are loaded automatically via AppServiceProvider.
php artisan test --compact php artisan test --compact --filter=testName
Tech Stack
- Laravel 12
- Livewire 4
- Flux UI
- Tailwind CSS 4
- Laravel Fortify
- Spatie Event Sourcing
- Spatie Multitenancy
- Spatie Media Library
- Pest
License
The MIT License (MIT). See LICENSE for details.
inmanturbo/enterprise 适用场景与选型建议
inmanturbo/enterprise 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 inmanturbo/enterprise 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 inmanturbo/enterprise 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 inmanturbo/enterprise 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Alfabank REST API integration
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
Laravel package for Accurate Online API integration.
The skeleton application for the Geoffrey agent framework.
Shared RCX Laravel DataTables UI and configuration helpers.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-19