base commit

This commit is contained in:
Mekan1206
2026-07-30 17:24:40 +05:00
commit a794dacd39
345 changed files with 29597 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace App\Filament\Resources\Users\Schemas;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Hash;
class UserForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextInput::make('name')
->required()
->maxLength(255),
TextInput::make('email')
->label('Email address')
->email()
->required()
->maxLength(255)
->unique(ignoreRecord: true),
TextInput::make('password')
->password()
->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')
->maxLength(255),
Select::make('department_id')
->relationship('department', 'name')
->searchable()
->preload()
->label('Department (for managers)'),
Select::make('roles')
->relationship('roles', 'name')
->multiple()
->preload()
->searchable()
->required(),
]);
}
}