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.
- 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
You can install this package via Composer:
composer require cslant/github-project-php
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.
See the Usage - GitHub Project PHP Documentation for a list of usage.
Please check and update some configurations in the documentation.
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
To add support for a custom field type:
- Create a new template file in the
field_types
directory - 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
GitHub Flavored Markdown (GFM) is supported. You can use:
**bold**
for bold text*italic*
for italic text`code`
for inline codecode blocks
for multi-line code- links for URLs
- HTML is also supported for more complex formatting
- Keep messages concise but informative
- Use consistent formatting
- Include relevant context
- Handle null/empty values gracefully
- Use emoji sparingly for visual cues
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
Please see the GitHub Project PHP Documentation for more information.
The MIT License (MIT). Please see License File for more information.