laraveldaily / filacheck
Static analysis for Filament projects - detect deprecated patterns and code issues
Installs: 212
Dependents: 0
Suggesters: 0
Security: 0
Stars: 27
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/laraveldaily/filacheck
Requires
- php: ^8.1
- filament/filament: ^4.0|^5.0
- nikic/php-parser: ^5.0
- symfony/console: ^6.0|^7.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
Suggests
- laraveldaily/filacheck-pro: Unlock performance rules, best practices checks, and more advanced static analysis
README
Static analysis for Filament v4/v5 projects. Detect deprecated patterns and code issues.
FilaCheck is like Pint but for Filament - run it after AI agents generate code or during CI to catch common issues.
Installation
composer require laraveldaily/filacheck --dev
Usage
You can run Filacheck as a Terminal or Artisan command.
Standalone
# Scan default app/Filament directory vendor/bin/filacheck # Scan specific directory vendor/bin/filacheck app/Filament/Resources # Show detailed output with categories vendor/bin/filacheck --detailed
Laravel Artisan Command
php artisan filacheck php artisan filacheck app/Filament/Resources php artisan filacheck --detailed
Auto-fixing Issues (Beta)
FilaCheck can automatically fix many issues it detects:
# Fix issues automatically vendor/bin/filacheck --fix # Fix with backup files (creates .bak files before modifying) vendor/bin/filacheck --fix --backup
Warning: The auto-fix feature is in early stages. Always ensure your code is committed to version control (e.g., Git/GitHub) before running
--fixso you can easily review and revert changes if needed.
Available Rules
FilaCheck includes 8 rules for detecting deprecated code patterns:
Deprecated Code
| Rule | Description |
|---|---|
deprecated-reactive |
Detects ->reactive() which should be replaced with ->live() |
deprecated-action-form |
Detects ->form() on Actions which should be ->schema() |
deprecated-filter-form |
Detects ->form() on Filters which should be ->schema() |
deprecated-placeholder |
Detects Placeholder::make() which should be TextEntry::make()->state() |
deprecated-mutate-form-data-using |
Detects ->mutateFormDataUsing() which should be ->mutateDataUsing() |
deprecated-empty-label |
Detects ->label('') which should be ->hiddenLabel() |
deprecated-forms-set |
Detects use Filament\Forms\Set which should be use Filament\Schemas\Components\Utilities\Set |
deprecated-image-column-size |
Detects ->size() on ImageColumn which should be ->imageSize() |
Example Output
FilaCheck v0.1
Scanning: app/Filament
..x..x.......
deprecated-reactive (Deprecated Code)
app/Filament/Resources/UserResource.php
Line 45: The `reactive()` method is deprecated.
→ Use `live()` instead of `reactive()`.
deprecated-action-form (Deprecated Code)
app/Filament/Resources/PostResource.php
Line 78: The `form()` method is deprecated on Actions.
→ Use `schema()` instead of `form()`.
Rules: 4 passed, 2 failed
Issues: 2 warning(s)
Exit Codes
0- No violations found1- Violations found
This makes FilaCheck perfect for CI pipelines.
FilaCheck Pro (Coming Soon)
I'm working on FilaCheck Pro with additional performance and best practices rules:
Performance Rules (planned)
| Rule | Description |
|---|---|
too-many-columns |
Warns when tables have more than 10 columns |
select-relationship-preload |
Detects Select with ->relationship() missing ->preload() |
table-defer-loading |
Suggests adding ->deferLoading() to tables |
table-missing-eager-loading |
Detects relationship columns without eager loading |
large-option-list-searchable |
Suggests ->searchable() for lists with 10+ options |
Best Practices Rules (planned)
| Rule | Description |
|---|---|
string-icon-instead-of-enum |
Detects string icons like 'heroicon-o-pencil' - use Heroicon::Pencil enum instead |
unnecessary-unique-ignore-record |
Detects ->unique(ignoreRecord: true) which is now the default in Filament v4 |
Interested? Star this repo and follow @PovilasKorop for updates.
CI Integration
GitHub Actions
name: FilaCheck on: [push, pull_request] jobs: filacheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.2' - name: Install dependencies run: composer install --no-progress --prefer-dist - name: Run FilaCheck run: vendor/bin/filacheck
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License. See LICENSE for details.