Skip to content
Agentmart
Submit a tool

filament-schema-class

Aplicar quando compor schema de form Filament v5 para Model Laravel em Resource existente.

Skill by coringawc

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/coringawc-filament-schema-class

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Aplicar quando compor schema de form Filament v5 para Model Laravel em Resource existente.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/filament-schema-class

What's inside

Skill name
filament-schema-class
Description
Aplicar quando compor schema de form Filament v5 para Model Laravel em Resource existente.
License
MIT
Metadata
author: coringawc · version: 2.0.0
Instructions
147 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Filament Schema Class

## Consistency First

Schema de form Filament v5 vive em classe sibling ao `Pages/` do Resource: `app/Filament/<Panel>/Resources/<ModelPlural>/Schemas/<Model>Form.php`. A classe expõe `public static function configure(Schema $schema): Schema` e o Resource delega via `return <Model>Form::configure($schema);`. Toda string visível usa chave-frase em inglês via `__()` resolvida em `lang/pt_BR.json` conforme `.agents/skills/translation/rules/translation-rules.md`.

Não existe "schema global" fora do Resource — schemas são sibling do Resource. Reuso entre painéis ou entre Resources distintos se resolve com método estático compartilhado dentro de um único sibling, traits dedicadas ou componentes reutilizáveis (`filament-form-component-reusable`).

## Quick Reference

- Path canônico: `app/Filament/<Panel>/Resources/<ModelPlural>/Schemas/<Model>Form.php`.
- Assinatura padrão: `public static function configure(Schema $schema): Schema`.
- Resource delega: `return <Model>Form::configure($schema);`.
- Componentes de form: `Filament\Forms\Components\*`.
- Layouts (Section, Grid, Fieldset, Tabs): `Filament\Schemas\Components\*`.
- Schema container: `Filament\Schemas\Schema`.
- Utilities reativas: `Filament\Schemas\Components\Utilities\Get` e `Set`.
- Validação inline no componente: `->required()`, `->maxLength()`, `->unique()`, `->rules()`.
- Labels via `__('English phrase')`; sem `__('labels.xxx')` e sem `lang/<locale>/labels.php`.
- Reuso entre schemas do mesmo painel: método privado/protegido estático no próprio `<Model>Form`. Promover a componente reutilizável apenas quando aparecer em 2+ schemas independentes.

## Workflow

- [ ] Identificar Model, painel alvo e padrão de Resources do projeto antes de criar a classe.

- [ ] Gerar o Resource via Sail se ainda não existir (a classe sibling é criada manualmente em seguida):

```bash
vendor/bin/sail artisan make:filament-resource Project --panel=app --no-interaction
```

- [ ] Criar `app/Filament/App/Resources/Projects/Schemas/ProjectForm.php` com `configure()` e composição em método dedicado:

```php
namespace App\Filament\App\Resources\Projects\Schemas;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Fieldset;
use Filament\Schemas\Schema;

class ProjectForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->columns(1)
            ->components(self::components());
    }

    /**
     * @return array<int, Fieldset>
     */
    public static function components(): array
    {
        return [
            Fieldset::make(__('Project details'))
                ->schema([
                    self::titleField(),
                    self::statusField(),
                ]),
        ];
    }

    private static function titleField(): TextInput
    {
        return TextInput::make('title')
            ->label(__('Title'))
            ->required()
            ->maxLength(255)
            ->validationAttribute(__('Title'));
    }

    private static function statusField(): Select
    {
        return Select::make('status')
            ->label(__('Status'))
            ->required()
            ->native(false);
    }
}
```

- [ ] No Resource, delegar o form ao sibling:

```php
use App\Filament\App\Resources\Projects\Schemas\ProjectForm;
use Filament\Schemas\Schema;

public static function form(Schema $schema): Schema
{
    return ProjectForm::configure($schema);
}
```

- [ ] Usar `Get`/`Set` para reatividade entre campos dentro do schema:

```php
use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Components\Utilities\Set;
use Illuminate\Support\Str;

TextInput::make('title')
    ->live(onBlur: true)
    ->afterStateUpdated(fn (Set $set, ?string $state): mixed => $set(
        'slug',
        Str::slug($state ?? ''),
    ));

TextInput::make('company_name')
    ->visible(fn (Get $get): bool => $get('type') === 'business');
```

- [ ] Adicionar cada label nova em `lang/pt_BR.json` conforme `.agents/skills/translation/rules/translation-rules.md` §8 (ler, mesclar preservando ordem, validar parse).

- [ ] Cobrir com Pest: create, edit, validações principais e comportamento reativo (`afterStateUpdated`, `visible`).

## Anti-Patterns

From CoringaWc/ai-first-kit, MIT.

More from CoringaWc/ai-first-kit

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
May 26, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
2.0.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from coringawc

Cite this page

filament-schema-class skill. Agent Mart. https://agentmart.dev/skills/coringawc-filament-schema-class (last updated 2026-10-24)