cslant/github-project-php
最新稳定版本:v1.2.0
Composer 安装命令:
composer require cslant/github-project-php
包简介
A PHP package for managing GitHub projects with Laravel
关键字:
README 文档
README
📝 Introduction
GitHub Project PHP is a package that helps you manage your Github projects in PHP.
It provides a simple and easy-to-use webhooks system to get the GitHub project's actions and implement comments on all activities in the project.
Available Field Type Templates
Standard Field Types
- text - For simple text fields
- number - For numeric fields
- date - For date fields (formatted as Y-m-d)
- single_select - For single-select dropdowns with color support
- multi_select - For multi-select fields
- checkbox - For boolean/toggle fields
- textarea - For long text content with diff view
- iteration - For iteration/sprint fields
- labels - For label/tag fields
- assignees - For user assignment fields
- milestone - For milestone tracking
- unsupported - Fallback for unknown field types
📋 Requirements
🔧 Installation
You can install this package via Composer:
composer require cslant/github-project-php
Customizing Templates
You can publish and customize the templates by running:
php artisan vendor:publish --tag=github-project-views
This will copy the templates to resources/views/vendor/github-project/md/field_types/ where you can modify them.
🚀 Usage
See the Usage - GitHub Project PHP Documentation for a list of usage.
Please check and update some configurations in the documentation.
Template Variables
All field type templates receive the following variables:
$fieldName- The display name of the field$fieldType- The type of the field (e.g., 'text', 'number')$fromValue- The previous value of the field$toValue- The new value of the field$fieldData- Raw field data from the webhook
Adding Custom Field Types
To add support for a custom field type:
- Create a new template file in the
field_typesdirectory - Name it with your field type (e.g.,
custom_type.blade.php) - The template will automatically be used when a field of that type is encountered
Styling
GitHub Flavored Markdown (GFM) is supported. You can use:
**bold**for bold text*italic*for italic text`code`for inline codecode blocksfor multi-line code- links for URLs
- HTML is also supported for more complex formatting
Best Practices
- Keep messages concise but informative
- Use consistent formatting
- Include relevant context
- Handle null/empty values gracefully
- Use emoji sparingly for visual cues
Example Custom Template
Here's an example of a custom field type template:
@if($fromValue != null && $toValue != null) **`{{ $fieldName }}`** changed from **`{{ $fromValue }}`** to **`{{ $toValue }}`** @elseif($toValue) **`{{ $fieldName }}`** set to **`{{ $toValue }}`** @else **`{{ $fieldName }}`** cleared @endif
📖 Official Documentation
Please see the GitHub Project PHP Documentation for more information.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 301
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-11