refactor loan paid off letter for clarity and consistency
This commit is contained in:
56
app/Filament/Resources/Users/Schemas/UserForm.php
Normal file
56
app/Filament/Resources/Users/Schemas/UserForm.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
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
|
||||
->columns(2)
|
||||
->components([
|
||||
TextInput::make('first_name')
|
||||
->label(__('First name'))
|
||||
->required(),
|
||||
|
||||
TextInput::make('last_name')
|
||||
->label(__('Last name'))
|
||||
->required(),
|
||||
|
||||
TextInput::make('username')
|
||||
->label(__('Username'))
|
||||
->required()
|
||||
->unique(ignoreRecord: true),
|
||||
|
||||
TextInput::make('phone')
|
||||
->label(__('Phone number'))
|
||||
->required()
|
||||
->unique(ignoreRecord: true),
|
||||
|
||||
TextInput::make('email')
|
||||
->label(__('Email'))
|
||||
->email()
|
||||
->unique(ignoreRecord: true),
|
||||
|
||||
TextInput::make('password')
|
||||
->label(__('Password'))
|
||||
->password()
|
||||
->dehydrateStateUsing(fn ($state) => Hash::make($state))
|
||||
->dehydrated(fn ($state) => filled($state))
|
||||
->required(fn (string $context): bool => $context === 'create'),
|
||||
|
||||
Select::make('roles')
|
||||
->label(__('Roles'))
|
||||
->relationship('roles', 'name')
|
||||
->multiple()
|
||||
->preload()
|
||||
->native(false)
|
||||
->required(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user