translate base
This commit is contained in:
@@ -29,7 +29,10 @@ class DocumentsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'documents';
|
||||
|
||||
protected static ?string $title = 'Employee Documents';
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __("hr.relation_managers.employee_documents");
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
@@ -43,7 +46,7 @@ class DocumentsRelationManager extends RelationManager
|
||||
->required()
|
||||
->maxLength(255),
|
||||
HrForm::fileUpload('file_path')
|
||||
->label('Document')
|
||||
->label(__('hr.fields.document'))
|
||||
->required()
|
||||
->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
|
||||
->maxSize(15360),
|
||||
@@ -56,7 +59,7 @@ class DocumentsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('title')
|
||||
->columns([
|
||||
TextColumn::make('document_type')
|
||||
->label('Type')
|
||||
->label(__('hr.fields.type'))
|
||||
->badge()
|
||||
->color(fn (DocumentType $state): string => $state->color())
|
||||
->formatStateUsing(fn (DocumentType $state): string => $state->label())
|
||||
@@ -71,7 +74,7 @@ class DocumentsRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('document_type')
|
||||
->label('Type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(DocumentType::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
@@ -80,7 +83,7 @@ class DocumentsRelationManager extends RelationManager
|
||||
])
|
||||
->recordActions([
|
||||
Action::make('download')
|
||||
->label('Download')
|
||||
->label(__('hr.actions.download'))
|
||||
->icon('heroicon-o-arrow-down-tray')
|
||||
->visible(fn (EmployeeDocument $record): bool => filled($record->file_path))
|
||||
->action(function (EmployeeDocument $record) {
|
||||
|
||||
Reference in New Issue
Block a user