Refactor Bonus, DisciplinaryReport, Gift, and Explanation schemas to enhance layout and organization. Introduce sections for better categorization of information, improve date picker functionality, and update localization for various fields across multiple languages.
This commit is contained in:
@@ -18,7 +18,8 @@ class GiftForm
|
||||
DatePicker::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
->default(now())
|
||||
->native(false),
|
||||
TextInput::make('gift_name')
|
||||
->label(__('hr.fields.gift_name'))
|
||||
->required()
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Gifts\Schemas;
|
||||
|
||||
use App\Models\Gift;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class GiftInfolist
|
||||
@@ -12,32 +15,44 @@ class GiftInfolist
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->date(),
|
||||
TextEntry::make('gift_name')
|
||||
->label(__('hr.fields.gift_name')),
|
||||
TextEntry::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->numeric(),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Gift $record): bool => $record->trashed()),
|
||||
Section::make(__('hr.sections.basic_info'))
|
||||
->schema([
|
||||
TextEntry::make('employee.full_name')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->date('d.m.Y'),
|
||||
TextEntry::make('gift_name')
|
||||
->label(__('hr.fields.gift_name')),
|
||||
])
|
||||
->columns(3),
|
||||
Section::make(__('hr.sections.gift_details'))
|
||||
->schema([
|
||||
TextEntry::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->money('TMT'),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('—')
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(2),
|
||||
Section::make(__('hr.sections.metadata'))
|
||||
->schema([
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime('d.m.Y H:i')
|
||||
->placeholder('—'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime('d.m.Y H:i')
|
||||
->placeholder('—'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime('d.m.Y H:i')
|
||||
->visible(fn (Gift $record): bool => $record->trashed()),
|
||||
])
|
||||
->columns(2),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user