first&last
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?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('Отчет: Оборудование');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user