laraveldaily/filacheck 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laraveldaily/filacheck

Composer 安装命令:

composer require laraveldaily/filacheck

包简介

Static analysis for Filament projects - detect deprecated patterns and code issues

README 文档

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 command.

# 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

Scan Only Dirty Files

Scan only files with uncommitted git changes, similar to Laravel Pint's --dirty option:

# Scan only uncommitted files
vendor/bin/filacheck --dirty

# Auto-fix only dirty files
vendor/bin/filacheck --dirty --fix

# Preview fixes for dirty files only
vendor/bin/filacheck --dirty --dry-run

Auto-fixing Issues (Beta)

FilaCheck can automatically fix many issues it detects:

# Fix issues automatically
vendor/bin/filacheck --fix

# Preview suggested fixes without modifying files
vendor/bin/filacheck --dry-run

# 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 --fix so you can easily review and revert changes if needed.

Configuration

You can optionally publish the config file to disable individual rules:

php artisan vendor:publish --tag=filacheck-config

To disable a rule, set enabled to false:

// config/filacheck.php
'deprecated-reactive' => [
    'enabled' => false,
],

All rules are enabled by default.

Available Rules (16 Free)

FilaCheck includes the following rules for detecting deprecated code patterns and common issues:

Best Practices (2 rules)

Rule Description Fixable
action-in-bulk-action-group Detects Action::make() inside BulkActionGroup::make() which should be BulkAction::make() Yes
wrong-tab-namespace Detects wrong Tab namespace - should be Filament\Schemas\Components\Tabs\Tab Yes

Deprecated Code (14 rules)

Rule Description Fixable
deprecated-reactive Detects ->reactive() which should be replaced with ->live() Yes
deprecated-action-form Detects ->form() on Actions which should be ->schema() Yes
deprecated-filter-form Detects ->form() on Filters which should be ->schema() Yes
deprecated-placeholder Detects Placeholder::make() which should be TextEntry::make()->state() No
deprecated-mutate-form-data-using Detects ->mutateFormDataUsing() which should be ->mutateDataUsing() Yes
deprecated-empty-label Detects ->label('') which should be ->hiddenLabel() (or ->iconButton() on Actions) Yes
deprecated-forms-get Detects use Filament\Forms\Get or callable $get which should use Filament\Schemas\Components\Utilities\Get Yes
deprecated-forms-set Detects use Filament\Forms\Set or callable $set which should use Filament\Schemas\Components\Utilities\Set Yes
deprecated-image-column-size Detects ->size() on ImageColumn which should be ->imageSize() Yes
deprecated-view-property Detects $view property not declared as protected string Yes
deprecated-bulk-actions Detects ->bulkActions() which should be replaced with ->toolbarActions() Yes
deprecated-url-parameters Detects deprecated URL parameters like tableFilters, activeTab, tableSearch, etc. Yes
deprecated-test-methods Detects deprecated test methods like setActionData(), mountTableAction(), assertFormSet(), etc. Partial
deprecated-image-editor-aspect-ratios Detects ->imageEditorAspectRatios() on FileUpload which should be ->imageEditorAspectRatioOptions() Yes

Example Output

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 found
  • 1 - Violations found

This makes FilaCheck perfect for CI pipelines.

FilaCheck Pro

FilaCheck Pro adds 19 additional rules for performance optimization, security, best practices, and UX suggestions.

Performance Rules (5 rules)

Rule Description Fixable
too-many-columns Warns when tables have more than 10 columns No
large-option-list-searchable Suggests ->searchable() for lists with 10+ options No
heavy-closure-in-format-state Detects database queries inside formatStateUsing() closures that cause N+1 issues No
stats-widget-polling-not-disabled Warns when StatsOverviewWidget uses the default 5-second polling interval Yes
navigation-badge-not-cached Warns when getNavigationBadge() is not cached using the Cache facade or cache() helper No

Security Rules (1 rule)

Rule Description Fixable
file-upload-missing-accepted-file-types Warns when FileUpload or SpatieMediaLibraryFileUpload is missing acceptedFileTypes() or image() No

Best Practices Rules (8 rules)

Rule Description Fixable
string-icon-instead-of-enum Detects string icons like 'heroicon-o-pencil' - use Heroicon::Pencil enum instead Yes
string-font-weight-instead-of-enum Detects string font weights like 'bold' - use FontWeight::Bold enum instead Yes
deprecated-notification-action-namespace Detects deprecated Filament\Notifications\Actions\Action namespace - use Filament\Actions\Action instead Yes
unnecessary-unique-ignore-record Detects ->unique(ignoreRecord: true) which is now the default in Filament v4 Yes
custom-theme-needed Detects Blade files using Tailwind CSS classes without a custom Filament theme configured No
file-upload-missing-max-size Warns when FileUpload or SpatieMediaLibraryFileUpload is missing maxSize() No
bulk-action-missing-deselect Warns when BulkAction is missing deselectRecordsAfterCompletion() Yes
enum-missing-filament-interfaces Warns when enums cast in Eloquent models are missing Filament interfaces like HasLabel No

UX Suggestions Rules (5 rules)

Rule Description Fixable
flat-form-overload Warns when form schema has more than 8 fields without any layout grouping (Sections, Tabs, Fieldsets, etc.) No
relationship-select-not-searchable Warns when Select with relationship() is missing searchable() No
missing-table-filters Warns when table has filterable columns (boolean, badge, icon) but no filters defined No
table-without-searchable-columns Warns when table has text columns but none are searchable No
filter-missing-indicator Warns when custom Filter has a schema() but no indicateUsing() or indicator() for active filter badges No

Get FilaCheck Pro at filamentexamples.com/filacheck.

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.

laraveldaily/filacheck 适用场景与选型建议

laraveldaily/filacheck 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 64.02k 次下载、GitHub Stars 达 119, 最近一次更新时间为 2026 年 02 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「lint」 「static-analysis」 「code-quality」 「livewire」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 laraveldaily/filacheck 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 laraveldaily/filacheck 我们能提供哪些服务?
定制开发 / 二次开发

基于 laraveldaily/filacheck 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 64.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 119
  • 点击次数: 29
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 119
  • Watchers: 5
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-02