Download the PHP package tomatophp/filament-cms-github without Composer
On this page you can find all versions of the php package tomatophp/filament-cms-github. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tomatophp/filament-cms-github
More information about tomatophp/filament-cms-github
Files in tomatophp/filament-cms-github
Package filament-cms-github
Short Description Github integration to import your repo docs README files as a docs on markdown format to TomatoPHP CMS
License MIT
Informations about the package filament-cms-github

Filament CMS GitHub Integration
GitHub integration for TomatoPHP CMS that automatically imports and synchronizes GitHub repository documentation (README files) as posts in your CMS. Perfect for maintaining documentation sites, portfolio showcases, or open-source project listings.
Screenshot

Features
- ๐ Automatic Import - Import GitHub repositories with a single click
- ๐ README Sync - Automatically fetches and converts README.md to post content
- ๐ GitHub Stats - Imports stars, forks, watchers, and issue counts
- ๐ฆ Packagist Integration - Fetches download statistics for PHP packages
- ๐ Bulk Refresh - Update all imported repositories at once
- ๐จ Avatar Images - Automatically downloads repository owner avatars
- ๐ท๏ธ Auto Tagging - Extracts keywords from Packagist data
- โก Queue Support - Background processing for better performance
- ๐ Notifications - User notifications on import success/failure
- ๐งช Full Test Coverage - 39 comprehensive tests
Installation
Install the package via composer:
Run the installation command:
Register the plugin in your Filament panel provider (/app/Providers/Filament/AdminPanelProvider.php):
Requirements
- PHP 8.2 or higher
- Laravel 10.x or 11.x
- Filament 3.x
- TomatoPHP CMS 4.x
Configuration
Queue Setup
This package dispatches jobs to the queue for better performance. Make sure your queue is configured:
Post Type Configuration
Imported repositories are saved as posts with type open-source. You can customize this in your CMS configuration.
Usage
Import Single Repository
- Navigate to your CMS Posts page in Filament
- Click the "Github Import" action button
- Enter repository URL(s) and redirect path(s)
- Click submit
Example:
Import Multiple Repositories
You can import multiple repositories at once:
Refresh All Repositories
To update all previously imported repositories with latest data:
- Use the "Refresh Github Links" action
- All posts with
type = 'open-source'and ameta_urlwill be updated
Programmatic Usage
Import Repository
Refresh Existing Post
Refresh All Posts
API Reference
GitHubService
The main service class for GitHub operations.
extractRepoFromUrl(string $url): string
Extracts repository name from GitHub URL.
fetchRepoData(string $repo): ?array
Fetches repository data from GitHub API.
fetchReadme(string $repo, string $branch = 'main'): ?string
Fetches README content from repository.
fetchPackagistData(string $packageName): ?array
Fetches package data from Packagist.
importRepository(string $url, ?int $userId = null, ?string $userType = null): ?Post
Imports a complete repository as a post.
refreshPost(Post $post): bool
Refreshes an existing post with latest GitHub data.
refreshAllPosts(): int
Refreshes all posts of type 'open-source' with meta_url.
Filament Actions
GithubImportAction
Provides a Filament action for importing repositories.
GithubRefreshAction
Provides a Filament action for refreshing all repositories.
Data Structure
Post Fields
Imported repositories are saved with the following structure:
Meta Fields
GitHub statistics are stored as meta fields:
github_starts- Star countgithub_watchers- Watcher countgithub_language- Primary languagegithub_forks- Fork countgithub_open_issues- Open issue countgithub_default_branch- Default branch namegithub_docs- Homepage/documentation URLdownloads_total- Total Packagist downloads (if available)downloads_monthly- Monthly downloadsdownloads_daily- Daily downloads
Accessing Meta Fields
Jobs
GitHubMetaGetterJob
Handles importing a single repository in the background.
GitHubMetaRefreshJob
Handles refreshing all repositories in the background.
Events
The package dispatches the following events:
TomatoPHP\FilamentCms\Events\PostCreated- When a repository is importedTomatoPHP\FilamentCms\Events\PostUpdated- When a repository is refreshed
Notifications
Users receive notifications for:
- Import Success - Repository imported successfully with link to view post
- Import Failure - Repository import failed with error details
- Refresh Success - All repositories refreshed successfully
Testing
The package includes comprehensive test coverage:
Test Structure
- GitHubServiceTest (17 tests) - Tests all service methods
- GitHubActionsTest (13 tests) - Tests Filament actions
- GitHubJobsTest (7 tests) - Tests job execution
- PluginTest (1 test) - Tests plugin registration
Publish Assets
Config File
Views
Translations
Migrations
Troubleshooting
Queue Not Processing
Make sure your queue worker is running:
For development, you can use sync driver in .env:
GitHub API Rate Limits
GitHub API has rate limits. For authenticated requests (recommended), generate a personal access token and configure it in your application.
README Not Found
The package tries multiple branch names automatically:
mainmaster- Default branch from GitHub API
If README is not found, the post will be created with empty body content.
Advanced Usage
Custom Post Processing
You can listen to the PostCreated event to perform custom processing:
Custom Notification Handling
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Development Setup
Testing
if you like to run PEST testing just use this command
Code Style
if you like to fix the code style, just use this command
PHPStan
if you like to check the code by PHPStan just use this command
Other Filament Packages
Check out our Awesome TomatoPHP
All versions of filament-cms-github with dependencies
tomatophp/console-helpers Version ^1.1
tomatophp/filament-cms Version ^4.0