base commit
This commit is contained in:
37
app/Filament/Resources/Gifts/Schemas/GiftForm.php
Normal file
37
app/Filament/Resources/Gifts/Schemas/GiftForm.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Gifts\Schemas;
|
||||
|
||||
use App\Filament\Support\HrForm;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class GiftForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
DatePicker::make('gift_date')
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('gift_name')
|
||||
->label('Gift Name')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('value')
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
->minValue(0)
|
||||
->step(0.01)
|
||||
->default(0),
|
||||
Textarea::make('reason')
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
36
app/Filament/Resources/Gifts/Schemas/GiftInfolist.php
Normal file
36
app/Filament/Resources/Gifts/Schemas/GiftInfolist.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Gifts\Schemas;
|
||||
|
||||
use App\Models\Gift;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class GiftInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('employee.id')
|
||||
->label('Employee'),
|
||||
TextEntry::make('gift_date')
|
||||
->date(),
|
||||
TextEntry::make('gift_name'),
|
||||
TextEntry::make('value')
|
||||
->numeric(),
|
||||
TextEntry::make('reason')
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('created_at')
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->dateTime()
|
||||
->visible(fn (Gift $record): bool => $record->trashed()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user