Run composer require laraveldaily/filacheck --dev in your Filament project. Start with a basic scan of your Filament directory:
vendor/bin/filacheck
For immediate feedback, use --dirty to scan only uncommitted changes:
vendor/bin/filacheck --dirty
Key first-use cases:
vendor/bin/filacheck --dirty to your pre-commit script to catch issues before merging.Pre-commit:
vendor/bin/filacheck --dirty --fix
Automatically fixes trivial issues (e.g., reactive() → live()) before committing.
Post-AI Code Generation:
vendor/bin/filacheck --dry-run
Preview fixes for AI-generated Filament resources without modifying files.
Team Onboarding:
Run vendor/bin/filacheck --detailed to explain deprecated patterns to new developers via the output.
- run: vendor/bin/pint
- run: vendor/bin/filacheck
php artisan vendor:publish --tag=filacheck-config) and disabling rules like:
'deprecated-reactive' => ['enabled' => false],
--fix selectively for rules marked "Partial" (e.g., test methods) by combining with --dry-run first.Performance Audits:
vendor/bin/filacheck --detailed | grep "Performance"
Identify tables with >10 columns or N+1 query risks in formatStateUsing().
Security Sweeps:
vendor/bin/filacheck --detailed | grep "Security"
Flag missing acceptedFileTypes() or maxSize() in file uploads.
Config Overrides Ignored:
config/filacheck.php (e.g., enabled: false) may not work in early versions (<1.1.0). Verify with vendor/bin/filacheck --dry-run.False Positives in Bulk Actions:
action-in-bulk-action-group rule may incorrectly flag Action::make() inside toolbarActions() (fixed in v1.1.2).Backup Risks:
--fix --backup creates .bak files but may not handle nested directories cleanly.--dry-run first to preview changes.Windows Paths:
C:\project) may cause scans to fail.C:/project) or update to v0.3.1+.--detailed to see rule categories and suppress noise:
vendor/bin/filacheck --detailed | grep -v "Best Practices"
--dry-run:
vendor/bin/filacheck --dry-run | grep "deprecated-reactive"
- run: vendor/bin/filacheck || exit 1
Custom Rules:
FilaCheck\Rules\Rule class to add project-specific checks (e.g., custom naming conventions).Rule Prioritization:
'deprecated-url-parameters' => ['enabled' => true],
'deprecated-reactive' => ['enabled' => true],
// Disable less urgent rules
'wrong-tab-namespace' => ['enabled' => false],
Fix Templates:
config/filacheck.php for consistent auto-fixes:
'fix_templates' => [
'deprecated-reactive' => '->live()',
],
git blame to track who introduced deprecated patterns:
vendor/bin/filacheck --detailed | awk '/Line/ {print $2}' | xargs -I{} git blame {} -L{},{}
--path to skip tests or legacy code:
vendor/bin/filacheck --path="app/Filament/Resources --exclude=app/Filament/Tests"
vendor/bin/filacheck --path="app/Filament/Resources/Pages"
vendor/bin/filacheck --path="app/Filament/Resources/Widgets"
How can I help you explore Laravel packages today?