33 lines
796 B
PHP
33 lines
796 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Reports;
|
|
|
|
use App\Services\ReportService;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Component;
|
|
|
|
#[Layout('layouts.app')]
|
|
class EquipmentReportPage extends Component
|
|
{
|
|
public string $dateFrom = '';
|
|
|
|
public string $dateTo = '';
|
|
|
|
public function mount(): void
|
|
{
|
|
abort_unless(auth()->user()->isAdmin() || auth()->user()->isManager(), 403);
|
|
}
|
|
|
|
public function render(ReportService $reportService)
|
|
{
|
|
$rows = $reportService->equipmentFailureFrequency([
|
|
'date_from' => $this->dateFrom ?: null,
|
|
'date_to' => $this->dateTo ?: null,
|
|
]);
|
|
|
|
return view('livewire.reports.equipment-report-page', [
|
|
'rows' => $rows,
|
|
])->title('Отчет: Оборудование');
|
|
}
|
|
}
|