base commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\EmployeeDocuments\Schemas;
|
||||
|
||||
use App\Enums\DocumentType;
|
||||
use App\Filament\Support\HrForm;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class EmployeeDocumentForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
Select::make('document_type')
|
||||
->options(DocumentType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('title')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
HrForm::fileUpload('file_path')
|
||||
->label('Document')
|
||||
->required()
|
||||
->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
|
||||
->maxSize(15360),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\EmployeeDocuments\Schemas;
|
||||
|
||||
use App\Models\EmployeeDocument;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class EmployeeDocumentInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('employee.id')
|
||||
->label('Employee'),
|
||||
TextEntry::make('document_type')
|
||||
->badge(),
|
||||
TextEntry::make('title'),
|
||||
TextEntry::make('file_path'),
|
||||
TextEntry::make('uploaded_at')
|
||||
->dateTime(),
|
||||
TextEntry::make('created_at')
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->dateTime()
|
||||
->visible(fn (EmployeeDocument $record): bool => $record->trashed()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user