laravel-filament
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<EXTREMELY-IMPORTANT>
This skill exists to keep Filament work aligned with v5, not to duplicate the entire reference library.
Non-negotiable rules:
- Read first.
references/namespaces.md - Then load only the reference files the task actually needs.
- Keep business logic out of Resources.
- Use the v5 action and table APIs, not old v3 patterns.
- Keep the heavy Filament cookbook in , not inline here.
references/
<EXTREMELY-IMPORTANT>
本技能旨在确保Filament开发工作与v5版本保持一致,而非复制整个参考库。
不可违背的规则:
- 首先阅读。
references/namespaces.md - 仅加载任务实际需要的参考文件。
- 不要在Resources中存放业务逻辑。
- 使用v5的action和table API,而非旧的v3模式。
- 将复杂的Filament使用手册放在目录下,不要内联在此处。
references/
laravel-filament
laravel-filament
Inputs
输入
- : The Filament admin task or component to modify
$request
- : 要修改的Filament管理任务或组件
$request
Goal
目标
Route Filament work through the correct v5 conventions so the implementation uses the right namespaces, table APIs, and admin-panel composition patterns.
通过正确的v5约定进行Filament开发工作,确保实现时使用正确的命名空间、表格API和管理面板组合模式。
Step 0: Read the v5 namespace contract
步骤0:阅读v5命名空间约定
Always start with:
references/namespaces.md
That establishes the namespace and API changes that commonly break Filament work.
Success criteria: The task is grounded in the correct Filament v5 surface before editing.
始终从以下文件开始:
references/namespaces.md
该文件定义了通常会导致Filament开发出错的命名空间和API变更。
成功标准:在开始编辑前,任务已基于正确的Filament v5 API完成准备。
Step 1: Load only the relevant admin references
步骤1:仅加载相关的管理参考文件
Use the routing table to pick reference files. Do not bulk-load everything.
| Task | Read |
|---|---|
| v5 namespace and API changes | |
| Creating or editing a Resource (CRUD) | |
| Form fields, sections, layout | |
| Table columns, sorting, searching | |
| Bulk actions, row actions, header actions | |
| Table filters, filter forms | |
| Relation managers, BelongsToMany, HasMany | |
| Dashboard widgets, stats, charts | |
| Multi-panel setup, navigation, tenancy | |
| Flash messages, database notifications | |
| Infolist entries, read-only views | |
| Testing resources, pages, actions | |
Multiple tasks? Read multiple files.
Success criteria: Only the task-relevant Filament conventions are in the active context.
使用路由表选择参考文件,不要批量加载所有文件。
| 任务 | 阅读文件 |
|---|---|
| v5命名空间和API变更 | |
| 创建或编辑Resource(CRUD) | |
| 表单字段、区块、布局 | |
| 表格列、排序、搜索 | |
| 批量操作、行操作、头部操作 | |
| 表格过滤器、筛选表单 | |
| 关联管理器、BelongsToMany、HasMany | |
| 仪表盘小部件、统计数据、图表 | |
| 多面板设置、导航、租户管理 | |
| 闪存消息、数据库通知 | |
| 信息列表条目、只读视图 | |
| 测试资源、页面、操作 | |
涉及多个任务?阅读多个文件。
成功标准:仅将与任务相关的Filament约定纳入当前上下文。
Step 2: Implement with the core Filament guardrails
步骤2:遵循核心Filament约束进行实现
Keep these rules active:
- actions come from
Filament\\Actions\\* - tables use the v5 record/toolbar/header action methods
- badge presentation uses
TextColumn->badge() - layout components come from the Schemas package
- Resource classes delegate real business work to application Actions
Success criteria: The change uses valid v5 APIs and stays maintainable.
始终遵守以下规则:
- 操作来自
Filament\\Actions\\* - 表格使用v5的record/toolbar/header操作方法
- 徽章展示使用
TextColumn->badge() - 布局组件来自Schemas包
- Resource类将实际业务工作委托给应用Actions
成功标准:修改使用有效的v5 API,且保持可维护性。
Step 3: Verify the admin surface
步骤3:验证管理面板界面
Use the narrowest relevant verification:
- focused feature tests
- Filament page/resource tests
- lightweight UI smoke coverage if the repo already has it
Success criteria: The Filament surface still behaves correctly after the change.
使用最相关的窄范围验证方式:
- 聚焦式功能测试
- Filament页面/资源测试
- 如果仓库已有相关覆盖,可进行轻量级UI冒烟测试
成功标准:修改后Filament界面仍能正常运行。
Guardrails
约束规则
- Do not inline the whole Filament handbook in .
SKILL.md - Do not skip .
references/namespaces.md - Do not use v3 action namespaces or deprecated table methods.
- Do not put business logic directly in Resource classes.
- 不要将完整的Filament手册内联到中。
SKILL.md - 不要跳过。
references/namespaces.md - 不要使用v3的操作命名空间或已弃用的表格方法。
- 不要将业务逻辑直接放在Resource类中。
When To Load References
何时加载参考文件
-
Always.
references/namespaces.md -
then only the task-relevant files under
references/
-
始终需要加载。
references/namespaces.md -
然后仅加载下与任务相关的文件
references/
Output Contract
输出约定
Report:
- which Filament references were loaded
- the v5 pattern applied
- the change made
- the verification run
报告内容:
- 加载了哪些Filament参考文件
- 应用的v5模式
- 所做的修改
- 执行的验证