base commit

This commit is contained in:
Mekan1206
2026-07-30 17:24:40 +05:00
commit a794dacd39
345 changed files with 29597 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace App\Filament\Resources\Employees\Widgets;
use App\Models\Employee;
use App\Services\Employee\EmployeeStatisticsService;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
class EmployeeStatsWidget extends StatsOverviewWidget
{
public ?Employee $record = null;
protected function getStats(): array
{
if (! $this->record instanceof Employee) {
return [];
}
$summary = app(EmployeeStatisticsService::class)->summary($this->record);
return [
Stat::make('Vacation Taken', (string) $summary->vacationTaken)
->description("{$summary->vacationRemaining} days remaining")
->descriptionIcon('heroicon-o-calendar')
->color('primary')
->icon('heroicon-o-sun'),
Stat::make('Sick Leaves', (string) $summary->sickLeaveCount)
->description('Total records')
->descriptionIcon('heroicon-o-heart')
->color('warning')
->icon('heroicon-o-heart'),
Stat::make('Disciplinary Reports', (string) $summary->reportsCount)
->description('On file')
->descriptionIcon('heroicon-o-exclamation-triangle')
->color('danger')
->icon('heroicon-o-exclamation-triangle'),
Stat::make('Total Bonuses', number_format($summary->bonusesTotal, 2).' TMT')
->description("{$summary->giftsCount} gifts received")
->descriptionIcon('heroicon-o-gift')
->color('success')
->icon('heroicon-o-banknotes'),
];
}
}