Enterprise-grade module management for Filament v4 & v5 admin panels
Complete lifecycle management with dependencies, updates, backups, and health monitoring
Built on Nwidart/laravel-modules
- Features
- Requirements
- Installation
- Quick Start
- Core Features
- Enterprise Features
- Configuration
- Usage Examples
- Contributing
- License
- π¦ Full CRUD Operations - View, install, enable, disable, and uninstall modules
- π€ Multiple Installation Methods - ZIP upload, GitHub repository, or local path
- π·οΈ Multi-Module Packages - Install multiple modules from a single package
- π Dashboard Widget - Real-time statistics and module overview
- π Multi-Language Support - 20+ languages included
- βοΈ Highly Configurable - Customize navigation, uploads, and behavior
|
|
| Requirement | Version | Status |
|---|---|---|
| 8.3+ | β | |
| 10+ | β | |
| v4/v5 | β |
Dependencies:
- Nwidart Laravel Modules - Module foundation
- Spatie Laravel Data - Type-safe DTOs
composer require alizharb/filament-module-managerAdd to your AdminPanelProvider:
use Alizharb\FilamentModuleManager\FilamentModuleManagerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(FilamentModuleManagerPlugin::make());
}# Publish configuration
php artisan vendor:publish --tag="filament-module-manager-config"
# Publish translations
php artisan vendor:publish --tag="filament-module-manager-translations"Navigate to Module Manager in your Filament admin sidebar.
Option 1: Upload ZIP
- Prepare module as ZIP with
module.jsonin root - Click "Upload Module" button
- Select ZIP file (max 20MB by default)
- Module installs and appears in list
Option 2: Install from GitHub
- Add repository to module's
module.json:{ "name": "Blog", "repository": "username/blog-module" } - Use GitHub installation feature
- Module downloads and installs automatically
- Toggle module status with one click
- Automatic dependency validation
- Cache clearing after changes
Upload modules as ZIP files with automatic validation:
MyModule.zip
βββ MyModule/
βββ module.json # Required
βββ composer.json # Optional
βββ Config/
βββ Http/
βββ resources/
Features:
- β Automatic module.json validation
- β Folder name correction
- β Metadata extraction
- β Duplicate detection
- β Size limit enforcement
Install multiple modules from a single package:
// package.json in ZIP root
{
"name": "my-module-collection",
"version": "1.0.0",
"modules": ["Modules/Blog", "Modules/Shop", "Modules/User"]
}Upload the package ZIP and all modules install automatically.
Install directly from GitHub repositories:
// module.json
{
"name": "Blog",
"version": "1.0.0",
"repository": "username/blog-module"
}Features:
- β Branch fallback (main β master)
- β OAuth token support for private repos
- β Automatic extraction and installation
Real-time module statistics:
- π’ Active Modules - Currently enabled
- π΄ Disabled Modules - Installed but inactive
- π Total Modules - All installed modules
Configure widget placement:
'widget' => [
'enabled' => true,
'show_on_dashboard' => true,
'show_on_module_page' => true,
],Automatically manage module dependencies with validation and conflict prevention.
In your module.json:
{
"name": "Blog",
"version": "1.0.0",
"requires": {
"User": "^1.0",
"Media": "~2.0",
"Core": "*"
}
}| Constraint | Meaning | Example |
|---|---|---|
^1.0 |
Caret | >=1.0.0 <2.0.0 |
~2.0 |
Tilde | >=2.0.0 <2.1.0 |
* |
Any | Any version |
1.5.0 |
Exact | Exactly 1.5.0 |
- β Automatic Validation - Checks dependencies before install/enable
- β Circular Detection - Prevents circular dependency loops
- β Dependent Protection - Can't disable modules with active dependents
- β Dependency Tree - Visual representation of relationships
- β Installation Order - Topological sorting for correct order
use Alizharb\FilamentModuleManager\Services\ModuleDependencyService;
$service = app(ModuleDependencyService::class);
// Validate dependencies
$service->validateDependencies('Blog');
// Get dependency tree
$tree = $service->getDependencyTree('Blog');
// Check if can disable
$canDisable = $service->canDisable('User'); // false if Blog depends on it
// Get modules that depend on this one
$dependents = $service->getDependents('User'); // ['Blog', 'Shop']Check and apply updates from GitHub releases with automatic backups.
'updates' => [
'enabled' => true,
'auto_check' => false,
'check_frequency' => 24, // hours
],Add repository to module.json:
{
"name": "Blog",
"version": "1.0.0",
"repository": "username/blog-module"
}- β Version Comparison - Automatic detection of newer versions
- β Changelog Display - Shows release notes before updating
- β Automatic Backup - Creates backup before applying update
- β Tag/Release Support - Install from specific versions
- β Batch Updates - Check all modules at once
use Alizharb\FilamentModuleManager\Services\ModuleUpdateService;
$service = app(ModuleUpdateService::class);
// Check for update
$updateData = $service->checkForUpdate('Blog');
if ($updateData->updateAvailable) {
echo "Update available: {$updateData->latestVersion}";
echo "Changelog: {$updateData->changelog}";
// Apply update
$service->updateModule('Blog');
}
// Batch check all modules
$updates = $service->batchCheckUpdates();Automatic backups before critical operations with one-click restore.
'backups' => [
'enabled' => true,
'backup_before_update' => true,
'backup_before_uninstall' => true,
'retention_days' => 30,
],- β Automatic Backups - Before updates and uninstalls
- β ZIP Compression - Efficient storage
- β Metadata Tracking - Size, date, reason, user
- β One-Click Restore - Restore from backup instantly
- β Retention Management - Auto-cleanup old backups
- Backups:
storage/app/module-backups/*.zip - Metadata:
storage/app/module-backups/backups.json
use Alizharb\FilamentModuleManager\Services\ModuleBackupService;
$service = app(ModuleBackupService::class);
// Create backup
$backup = $service->createBackup('Blog', 'Manual backup');
// List backups
$backups = $service->getBackups('Blog');
// Restore from backup
$service->restoreBackup($backup->id);
// Delete old backups
$service->deleteBackup($backup->id);Automated health checks with scoring and status categorization.
'health_checks' => [
'enabled' => true,
'auto_check' => true, // After install/update
],| Check | Description |
|---|---|
| Module Exists | Module directory is present |
| module.json | Configuration file exists and valid |
| composer.json | Composer file exists (if used) |
| Service Provider | Provider class exists |
| Dependencies | All dependencies are met |
| Files Intact | Core files are present |
- π’ Healthy (80-100) - All checks passed
- π‘ Warning (50-79) - Some checks failed
- π΄ Critical (0-49) - Multiple failures
- Health Data:
storage/app/module-manager/health-checks.json
use Alizharb\FilamentModuleManager\Services\ModuleHealthService;
$service = app(ModuleHealthService::class);
// Check module health
$health = $service->checkHealth('Blog');
echo "Status: {$health->status}"; // healthy, warning, critical
echo "Score: {$health->score}/100";
echo "Message: {$health->message}";
// Individual checks
foreach ($health->checks as $check => $passed) {
echo "{$check}: " . ($passed ? 'β
' : 'β');
}Complete audit trail of all module operations for compliance and debugging.
- Action - install, uninstall, enable, disable, update, backup, restore
- Module Name - Which module was affected
- User - ID and name of user who performed action
- IP Address - Request IP
- User Agent - Browser/client information
- Timestamp - When action occurred
- Status - Success or failure
- Error Message - If action failed
- Metadata - Additional context
- Audit Logs:
storage/app/module-manager/audit-logs.json - Retention: Last 1000 entries
use Alizharb\FilamentModuleManager\Services\AuditLogService;
$service = app(AuditLogService::class);
// Log an action
$service->log(
action: 'install',
moduleName: 'Blog',
success: true,
metadata: ['version' => '1.0.0']
);
// Logs are automatically created for:
// - Module install/uninstall
// - Module enable/disable
// - Module updates
// - Backup creation/restorationAdvanced GitHub API integration with release management and OAuth support.
'github' => [
'token' => env('GITHUB_TOKEN'), // Optional, increases rate limits
'default_branch' => 'main',
'fallback_branch' => 'master',
],- β Release Management - Fetch and install from releases
- β Tag Support - Install specific versions
- β Changelog Retrieval - Display release notes
- β OAuth Token - Support for private repositories
- β Rate Limit Management - Handles API limits gracefully
- β Branch Fallback - Tries main, falls back to master
-
Add GitHub Token (Optional)
# .env GITHUB_TOKEN=ghp_your_token_here -
Add Repository to module.json
{ "name": "Blog", "version": "1.0.0", "repository": "username/blog-module" }
use Alizharb\FilamentModuleManager\Services\GitHubService;
$service = app(GitHubService::class);
// Get latest release
$release = $service->getLatestRelease('username/blog-module');
// Get all releases
$releases = $service->getAllReleases('username/blog-module');
// Get specific release
$release = $service->getReleaseByTag('username/blog-module', 'v1.0.0');
// Download release
$zipPath = $service->downloadRelease('username/blog-module', 'v1.0.0');
// Get changelog
$changelog = $service->getChangelog('username/blog-module', 'v1.0.0');'navigation' => [
'register' => true,
'sort' => 100,
'icon' => 'heroicon-o-code-bracket',
'group' => 'System',
'label' => 'Module Manager',
],'upload' => [
'disk' => 'public',
'temp_directory' => 'temp/modules',
'max_size' => 20 * 1024 * 1024, // 20MB
],'widget' => [
'enabled' => true,
'show_on_dashboard' => true,
'show_on_module_page' => true,
],'permissions' => [
'enabled' => true,
'prefix' => 'module',
'actions' => [
'view' => 'module.view',
'install' => 'module.install',
'uninstall' => 'module.uninstall',
'enable' => 'module.enable',
'disable' => 'module.disable',
'update' => 'module.update',
],
],use Alizharb\FilamentModuleManager\Facades\ModuleManager;
// Enable a module
ModuleManager::enable('Blog');
// Disable a module
ModuleManager::disable('Blog');
// Get module data
$module = ModuleManager::findModule('Blog');
// Install from ZIP
$result = ModuleManager::installModulesFromZip('/path/to/module.zip');
// Install from GitHub
$result = ModuleManager::installModuleFromGitHub('Blog');
// Uninstall module
$result = ModuleManager::uninstallModule('Blog');use Alizharb\FilamentModuleManager\Services\ModuleDependencyService;
$service = app(ModuleDependencyService::class);
// Get all dependencies
$dependencies = $service->getModuleDependencies('Blog');
// Get dependency tree
$tree = $service->getDependencyTree('Blog');
// Resolve installation order
$order = $service->resolveDependencies(['Blog', 'Shop', 'User']);use Alizharb\FilamentModuleManager\Services\ModuleHealthService;
$service = app(ModuleHealthService::class);
$health = $service->checkHealth('Blog');
if ($health->isCritical()) {
// Handle critical issues
Log::error("Module Blog has critical issues: {$health->message}");
}The package includes translations for 20+ languages:
- English, Arabic, Spanish, French, German
- Italian, Portuguese, Russian, Chinese, Japanese
- And more...
php artisan vendor:publish --tag="filament-module-manager-translations"Edit files in lang/vendor/filament-module-manager/.
We welcome contributions! Please see CONTRIBUTING.md for details.
# Clone repository
git clone https://github.com/AlizHarb/filament-module-manager.git
# Install dependencies
composer install
# Run tests
composer test
# Format code
composer format# Run all tests
composer test
# Run specific test
./vendor/bin/pest --filter=ModuleManagerTestIf this package helps you, consider sponsoring its development:
Your support helps maintain and improve this package! π
- π Bug Reports: Create an issue
- π‘ Feature Requests: Request a feature
- π¬ Discussions: Join the discussion
This project is licensed under the MIT License - see the LICENSE file for details.
- Filament PHP - Amazing admin panel framework
- Nwidart Laravel Modules - Solid module foundation
- Spatie - Excellent Laravel packages
- All contributors and supporters π
Made with β€οΈ by Ali Harb
Star β this repository if it helped you!
