Skip to content

Commit 5da625c

Browse files
committed
docs: update README for clarity and feature enhancements
1 parent cd83485 commit 5da625c

File tree

1 file changed

+63
-76
lines changed

1 file changed

+63
-76
lines changed

README.md

Lines changed: 63 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,108 @@
1-
# github-project-php 👋
1+
# GitHub Project PHP
22

33
<p align="center">
44
<a href="#"><img src="https://img.shields.io/github/license/cslant/github-project-php.svg?style=flat-square" alt="License"></a>
55
<a href="https://github.com/cslant/github-project-php/releases"><img src="https://img.shields.io/github/release/cslant/github-project-php.svg?style=flat-square" alt="Latest Version"></a>
66
<a href="https://packagist.org/packages/cslant/github-project-php"><img src="https://img.shields.io/packagist/dt/cslant/github-project-php.svg?style=flat-square" alt="Total Downloads"></a>
77
<a href="https://github.com/cslant/github-project-php/actions/workflows/setup_test.yml"><img src="https://img.shields.io/github/actions/workflow/status/cslant/github-project-php/setup_test.yml?label=tests&branch=main" alt="Test Status"></a>
88
<a href="https://github.com/cslant/github-project-php/actions/workflows/php-cs-fixer.yml"><img src="https://img.shields.io/github/actions/workflow/status/cslant/github-project-php/php-cs-fixer.yml?label=code%20style&branch=main" alt="Code Style Status"></a>
9+
</p>
910

10-
## 📝 Introduction
11+
## Introduction
1112

12-
GitHub Project PHP is a package that helps you manage your Github projects in PHP.
13+
GitHub Project PHP is a Laravel package that helps you manage your GitHub Projects (V2) in PHP.
1314

14-
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.
15+
It provides a simple webhook system to receive GitHub project events and automatically generate activity comments on issues and pull requests.
1516

16-
## Available Field Type Templates
17-
18-
### Standard Field Types
17+
## Features
1918

20-
1. **text** - For simple text fields
21-
2. **number** - For numeric fields
22-
3. **date** - For date fields (formatted as Y-m-d)
23-
4. **single_select** - For single-select dropdowns with color support
24-
5. **multi_select** - For multi-select fields
25-
6. **checkbox** - For boolean/toggle fields
26-
7. **textarea** - For long text content with diff view
27-
8. **iteration** - For iteration/sprint fields
28-
9. **labels** - For label/tag fields
29-
10. **assignees** - For user assignment fields
30-
11. **milestone** - For milestone tracking
31-
12. **unsupported** - Fallback for unknown field types
19+
- **Webhook Integration**: Receive and process GitHub Projects V2 webhook events
20+
- **Queue Support**: Process webhook events asynchronously for better performance
21+
- **API Endpoint**: Generate comment messages via REST API
22+
- **12+ Field Type Templates**: Built-in templates for all GitHub Project field types
23+
- **Customizable Templates**: Publish and customize Blade templates
24+
- **GitHub GraphQL API**: Direct integration with GitHub's GraphQL API
3225

33-
## 📋 Requirements
26+
## Requirements
3427

35-
- PHP ^8.3
28+
- PHP ^8.4
29+
- Laravel ^11.0|^12.0
3630
- [Composer](https://getcomposer.org/)
37-
- [Laravel](https://laravel.com/) ^10.0
3831

39-
## 🔧 Installation
40-
41-
You can install this package via Composer:
32+
## Installation
4233

4334
```bash
4435
composer require cslant/github-project-php
4536
```
4637

47-
### Customizing Templates
38+
## Available Field Type Templates
39+
40+
| Field Type | Description |
41+
|-----------------|--------------------------------------------|
42+
| `text` | Simple text fields |
43+
| `number` | Numeric fields |
44+
| `date` | Date fields (Y-m-d format) |
45+
| `single_select` | Single-select dropdowns with color support |
46+
| `multi_select` | Multi-select fields |
47+
| `checkbox` | Boolean/toggle fields |
48+
| `textarea` | Long text content with diff view |
49+
| `iteration` | Iteration/sprint fields |
50+
| `labels` | Label/tag fields |
51+
| `assignees` | User assignment fields |
52+
| `milestone` | Milestone tracking |
53+
| `unsupported` | Fallback for unknown field types |
54+
55+
## Usage
56+
57+
See the [GitHub Project PHP Documentation](https://docs.cslant.com/github-project-php/usage) for detailed usage instructions.
4858

49-
You can publish and customize the templates by running:
59+
### Customizing Templates
5060

5161
```bash
5262
php artisan vendor:publish --tag=github-project-views
5363
```
5464

55-
This will copy the templates to `resources/views/vendor/github-project/md/field_types/` where you can modify them.
56-
57-
## 🚀 Usage
58-
59-
See the [Usage - GitHub Project PHP Documentation](https://docs.cslant.com/github-project-php/usage)
60-
for a list of usage.
61-
62-
Please check and update some configurations in the documentation.
65+
This copies templates to `resources/views/vendor/github-project/md/field_types/`.
6366

6467
### Template Variables
6568

66-
All field type templates receive the following variables:
67-
68-
- `$fieldName` - The display name of the field
69-
- `$fieldType` - The type of the field (e.g., 'text', 'number')
70-
- `$fromValue` - The previous value of the field
71-
- `$toValue` - The new value of the field
72-
- `$fieldData` - Raw field data from the webhook
73-
74-
### Adding Custom Field Types
69+
All field type templates receive:
7570

76-
To add support for a custom field type:
71+
- `$fieldName` - Display name of the field
72+
- `$fieldType` - Type of the field
73+
- `$fromValue` - Previous value
74+
- `$toValue` - New value
75+
- `$fieldData` - Raw webhook data
7776

78-
1. Create a new template file in the `field_types` directory
79-
2. Name it with your field type (e.g., `custom_type.blade.php`)
80-
3. The template will automatically be used when a field of that type is encountered
77+
### API Endpoint
8178

82-
### Styling
79+
Generate comment messages via API:
8380

84-
GitHub Flavored Markdown (GFM) is supported. You can use:
81+
```
82+
POST /github-project/generate-comment
83+
Content-Type: application/json
8584
86-
- `**bold**` for bold text
87-
- `*italic*` for italic text
88-
- `` `code` `` for inline code
89-
- ```code blocks``` for multi-line code
90-
- [links](https://example.com) for URLs
91-
- HTML is also supported for more complex formatting
85+
{
86+
"payload": { ... }
87+
}
88+
```
9289

93-
### Best Practices
90+
### Queue Configuration
9491

95-
1. Keep messages concise but informative
96-
2. Use consistent formatting
97-
3. Include relevant context
98-
4. Handle null/empty values gracefully
99-
5. Use emoji sparingly for visual cues
92+
Enable queue processing in your config:
10093

101-
### Example Custom Template
94+
```php
95+
// config/github-project.php
96+
'is_queue_enabled' => true,
97+
```
10298

103-
Here's an example of a custom field type template:
99+
## Documentation
104100

105-
```blade
106-
@if($fromValue != null && $toValue != null)
107-
**`{{ $fieldName }}`** changed from **`{{ $fromValue }}`** to **`{{ $toValue }}`**
108-
@elseif($toValue)
109-
**`{{ $fieldName }}`** set to **`{{ $toValue }}`**
110-
@else
111-
**`{{ $fieldName }}`** cleared
112-
@endif
113-
```
101+
Full documentation available at [docs.cslant.com/github-project-php](https://docs.cslant.com/github-project-php)
114102

115-
## 📖 Official Documentation
103+
## Changelog
116104

117-
Please see the [GitHub Project PHP Documentation](https://docs.cslant.com/github-project-php) for more
118-
information.
105+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
119106

120107
## License
121108

0 commit comments

Comments
 (0)