60 lines
1.5 KiB
PHP
60 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Employees\Pages;
|
|
|
|
use App\Filament\Resources\Employees\EmployeeResource;
|
|
use App\Filament\Resources\Employees\Widgets\EmployeeStatsWidget;
|
|
use App\Filament\Support\ExportPdfAction;
|
|
use BokshornIt\FilamentActivityTimeline\Actions\ActivityTimelineAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Resources\Pages\ViewRecord;
|
|
|
|
class ViewEmployee extends ViewRecord
|
|
{
|
|
protected static string $resource = EmployeeResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
ActivityTimelineAction::make()
|
|
->withRelations([
|
|
'vacations',
|
|
'sickLeaves',
|
|
'unpaidLeaves',
|
|
'disciplinaryReports',
|
|
'explanations',
|
|
'bonuses',
|
|
'gifts',
|
|
'documents',
|
|
]),
|
|
ExportPdfAction::employeeProfile(),
|
|
ExportPdfAction::employeeLeaveSummary(),
|
|
EditAction::make(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array<class-string>
|
|
*/
|
|
protected function getHeaderWidgets(): array
|
|
{
|
|
return [
|
|
EmployeeStatsWidget::class,
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return int | array<string, ?int>
|
|
*/
|
|
public function getHeaderWidgetsColumns(): int | array
|
|
{
|
|
return [
|
|
'default' => 1,
|
|
'sm' => 2,
|
|
'xl' => 4,
|
|
];
|
|
}
|
|
}
|