PHPackages                             red-jasmine/project - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. red-jasmine/project

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

red-jasmine/project
===================

Red Jasmine Project Domain Package

1.0.13(5mo ago)0421MITPHP

Since Jan 22Pushed 5mo agoCompare

[ Source](https://github.com/red-jasmine/project)[ Packagist](https://packagist.org/packages/red-jasmine/project)[ RSS](/packages/red-jasmine-project/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (7)Used By (1)

Red Jasmine Project Package
===========================

[](#red-jasmine-project-package)

项目领域扩展包，提供完整的项目管理系统功能。

功能特性
----

[](#功能特性)

- **项目管理**：项目的创建、配置、激活、归档等生命周期管理
- **成员管理**：项目成员的加入、角色分配、权限管理
- **角色管理**：项目角色的创建、权限配置、成员分配
- **多租户隔离**：基于项目的数据隔离和配置隔离
- **多态关联**：支持多种组织类型和成员类型

安装
--

[](#安装)

```
composer require red-jasmine/project
```

配置
--

[](#配置)

发布配置文件：

```
php artisan vendor:publish --tag=project-config
```

发布数据库迁移：

```
php artisan vendor:publish --tag=project-migrations
php artisan migrate
```

使用示例
----

[](#使用示例)

### 创建项目

[](#创建项目)

```
use RedJasmine\Project\Domain\Models\Project;
use RedJasmine\Project\Domain\Models\Enums\ProjectType;
use RedJasmine\Project\Domain\Models\Enums\ProjectStatus;

$project = Project::create([
    'owner_type' => 'App\\Models\\Organization',
    'owner_id' => 1,
    'name' => '我的项目',
    'code' => 'MY_PROJECT',
    'project_type' => ProjectType::STANDARD,
    'status' => ProjectStatus::DRAFT,
]);
```

### 添加项目成员

[](#添加项目成员)

```
use RedJasmine\Project\Domain\Models\ProjectMember;
use RedJasmine\Project\Domain\Models\Enums\ProjectMemberStatus;

$member = $project->addMember($user, $role);
```

### 创建项目角色

[](#创建项目角色)

```
use RedJasmine\Project\Domain\Models\ProjectRole;
use RedJasmine\Project\Domain\Models\Enums\ProjectRoleStatus;

$role = ProjectRole::create([
    'project_id' => $project->id,
    'name' => '开发者',
    'code' => 'developer',
    'description' => '项目开发者角色',
    'permissions' => ['project.view', 'project.edit'],
    'status' => ProjectRoleStatus::ACTIVE,
]);
```

数据库表结构
------

[](#数据库表结构)

### projects（项目表）

[](#projects项目表)

- `id` - 主键
- `owner_type` - 所有者类型（多态关联）
- `owner_id` - 所有者ID（多态关联）
- `parent_id` - 父项目ID（支持项目分组）
- `name` - 项目名称
- `code` - 项目代码（所有者内唯一）
- `project_type` - 项目类型
- `status` - 项目状态
- `config` - 项目配置（JSON）

### project\_members（项目成员表）

[](#project_members项目成员表)

- `id` - 主键
- `project_id` - 项目ID
- `member_type` - 成员类型（多态关联）
- `member_id` - 成员ID（多态关联）
- `role_id` - 角色ID
- `status` - 成员状态
- `joined_at` - 加入时间
- `left_at` - 离开时间

### project\_roles（项目角色表）

[](#project_roles项目角色表)

- `id` - 主键
- `project_id` - 项目ID
- `name` - 角色名称
- `code` - 角色代码
- `permissions` - 角色权限（JSON）
- `status` - 角色状态

事件
--

[](#事件)

包提供了以下领域事件：

- `ProjectCreated` - 项目创建
- `ProjectActivated` - 项目激活
- `ProjectPaused` - 项目暂停
- `ProjectArchived` - 项目归档
- `MemberJoined` - 成员加入
- `MemberLeft` - 成员离开
- `MemberRoleChanged` - 成员角色变更
- `ProjectRoleCreated` - 角色创建
- `ProjectRoleDeleted` - 角色删除

许可证
---

[](#许可证)

MIT License

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance72

Regular maintenance activity

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

164d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aaaa10537dd96827181cb5ff0c4df6078f48054457d9ebaebe0b230829482843?d=identicon)[liushoukun](/maintainers/liushoukun)

---

Top Contributors

[![liushoukun](https://avatars.githubusercontent.com/u/26298472?v=4)](https://github.com/liushoukun "liushoukun (2 commits)")

### Embed Badge

![Health badge](/badges/red-jasmine-project/health.svg)

```
[![Health](https://phpackages.com/badges/red-jasmine-project/health.svg)](https://phpackages.com/packages/red-jasmine-project)
```

###  Alternatives

[lara-zeus/quantity

filamentphp Input Number component, with user-friendly increment and decrement controls

1975.6k10](/packages/lara-zeus-quantity)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
