* docs(openspec): propose setup-foundation change Add OpenSpec change for SPEC Phase 0 — Foundation with proposal, design, capability specs, and implementation tasks. Populate openspec/config.yaml with project context and artifact rules. Co-authored-by: Cursor <cursoragent@cursor.com> * feat: bootstrap Laravel 13 foundation (Fase 0) Implement OpenSpec change setup-foundation: Laravel 13 + Filament 5 admin panel, Livewire 4 public site shell, PostgreSQL via Compose, design tokens, role-based auth, quality gates (Pint/Larastan/Pest), FrankenPHP Dockerfile, and GitHub Actions CI with five blocking jobs. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): use valid APP_KEY for encryption in tests Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
50 lines
1.7 KiB
PHP
50 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Users\Schemas;
|
|
|
|
use App\Enums\UserRole;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Toggle;
|
|
use Filament\Schemas\Schema;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class UserForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
TextInput::make('name')
|
|
->label('Nome')
|
|
->required()
|
|
->maxLength(255),
|
|
TextInput::make('email')
|
|
->label('E-mail')
|
|
->email()
|
|
->required()
|
|
->maxLength(255)
|
|
->unique(ignoreRecord: true),
|
|
Select::make('role')
|
|
->label('Papel')
|
|
->options([
|
|
UserRole::Admin->value => UserRole::Admin->label(),
|
|
UserRole::Assistant->value => UserRole::Assistant->label(),
|
|
])
|
|
->required(),
|
|
Toggle::make('is_active')
|
|
->label('Ativo')
|
|
->default(true),
|
|
TextInput::make('password')
|
|
->label('Senha')
|
|
->password()
|
|
->revealable()
|
|
->dehydrateStateUsing(fn (?string $state): ?string => filled($state) ? Hash::make($state) : null)
|
|
->dehydrated(fn (?string $state): bool => filled($state))
|
|
->required(fn (string $operation): bool => $operation === 'create'),
|
|
]);
|
|
}
|
|
}
|