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>
This commit is contained in:
49
app/Filament/Resources/Users/Schemas/UserForm.php
Normal file
49
app/Filament/Resources/Users/Schemas/UserForm.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user