Download the PHP package panicdevs/modulite without Composer
On this page you can find all versions of the php package panicdevs/modulite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download panicdevs/modulite
More information about panicdevs/modulite
Files in panicdevs/modulite
Package modulite
Short Description Automatic Filament Panel Provider discovery for modular Laravel applications with multi-layer caching and performance optimization
License MIT
Homepage https://github.com/panicdevs/modulite
Informations about the package modulite
Modulite
Automatic Filament Panel Provider discovery for modular Laravel applications with intelligent caching and performance optimization.
Modulite automatically discovers and registers Filament panels and components across your modular application structure, eliminating the need for manual registration while providing production-ready performance optimizations.
Features
- 🔍 Automatic Discovery: Finds Filament panels, resources, pages, and widgets across modules
- ⚡ Production Optimized: File-based caching system similar to Laravel's bootstrap cache
- 🏗️ Modular Support: Works with both
nwidart/laravel-modulesandpanicdevs/modules - 🎯 Flexible Patterns: Configurable naming patterns and discovery locations
- 📊 Performance Insights: Built-in commands for monitoring and optimization
- 🛡️ Robust Error Handling: Graceful failure modes for production environments
Installation
Install via Composer:
Publish the configuration file:
Quick Start
- Install the package (configuration publishes automatically)
- Register the plugin in your Filament panel providers
- Structure your modules following the expected patterns
- Run optimization for production:
php artisan modulite:cache
Panel Registration
Add the ModulitePlugin to each panel where you want component discovery:
That's it! Modulite will automatically discover and register components for this panel.
How It Works
Discovery Process
Modulite works on two levels:
- Panel Providers: Automatically discovered and registered by the service provider
- Components: Discovered by the plugin for specific panels
- Resources: Filament resource classes for CRUD operations
- Pages: Custom Filament pages
- Widgets: Dashboard widgets and components
Module Structure
For a module named User, Modulite expects this structure:
Registration Flow
- Bootstrap: Service provider registers core services during Laravel boot
- Panel Discovery: Panel providers are automatically discovered and registered
- Plugin Registration:
ModulitePluginis registered with specific panels for component discovery - Component Discovery: When panel loads, plugin discovers components (resources, pages, widgets)
- Cache Check: Fast path checks cache file first (per panel)
- Scan & Cache: On cache miss, scans filesystem and caches results
- Component Registration: Discovered components auto-register to the specific panel
Configuration
Cache Settings
Configure caching behavior for optimal performance:
Key Settings:
enabled: Master cache toggle (auto: off in development, on in production)ttl: Cache lifetime in seconds (0 = never expires, recommended for production)auto_invalidate: Automatically clear cache when files change (development only)
Discovery Locations
Define where to scan for components:
Placeholders:
*: Module wildcard (e.g.,User,Blog){panel}: Panel ID placeholder (e.g.,Admin,Manager)
Validation Rules
Control how strict discovery validation should be:
When to Use:
strict_inheritance => true: Enforces exact class inheritanceallow_custom_base_classes => false: Only allows direct Filament class inheritance- Use strict settings for large teams to enforce conventions
Module Integration
Choose your module management approach:
Performance Optimization
Configure for production performance:
Environment Variables
Set these in your .env for easy configuration:
Production Setup
Optimization Commands
Deployment Workflow
- Build Assets: Run your normal build process
- Cache Application:
php artisan optimize - Cache Modulite:
php artisan modulite:cache - Deploy: Your cached discoveries are ready
Cache Management
The cache system works like Laravel's bootstrap cache:
Troubleshooting
Check Discovery Status
This shows:
- Configuration summary
- Module status
- Discovered panels and components
- Cache statistics
Common Issues
No panels discovered:
- Check module structure matches expected patterns
- Verify panel classes extend
PanelProvider - Check if modules are enabled
Performance issues:
- Enable caching:
MODULITE_CACHE_ENABLED=true - Set TTL to 0 for production:
MODULITE_CACHE_TTL=0 - Run
php artisan modulite:cache
Components not showing:
- Verify directory structure matches panel patterns
- Check component naming (must end with
Resource,Page,Widget) - Ensure components extend proper Filament base classes
Debug Mode
Enable detailed logging in development:
Cache Issues
Clear all caches if you encounter stale data:
Performance
Benchmarks
- Cold start (no cache): ~1-20ms depending on module count
- Warm cache: ~1-2ms (file include time)
- Laravel response overhead: <1ms when optimized
Production Optimizations
Modulite automatically optimizes for production:
- Static caching eliminates repeated file reads
- Lazy discovery defers scanning until needed
- Single cache file minimizes I/O operations
- TTL of 0 prevents unnecessary expiration checks
Advanced Usage
Custom Base Classes
You can use custom base classes for components:
Manual Component Registration
For edge cases, disable auto-discovery and register manually:
Multiple Panel Support
Modulite automatically handles multiple panels per module. Each panel needs the plugin registered for component discovery:
Components are discovered based on directory structure:
Requirements
- PHP 8.2+
- Filament 4.0+
Support
- 📖 Documentation
- 🐛 Issues
Made with ❤️ by PanicDevs