fedi-feed-router/app/Livewire/Dashboard.php
myrmidex d2919758f5
All checks were successful
CI / ci (push) Successful in 5m52s
CI / ci (pull_request) Successful in 5m46s
Build and Push Docker Image / build (push) Successful in 4m6s
Fix Pint 1.29.0 lint issues and update CI workflow
2026-03-18 20:01:25 +01:00

37 lines
874 B
PHP

<?php
namespace App\Livewire;
use App\Services\DashboardStatsService;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class Dashboard extends Component
{
public string $period = 'today';
public function mount(): void
{
// Default period
}
public function setPeriod(string $period): void
{
$this->period = $period;
}
public function render(): View
{
$service = app(DashboardStatsService::class);
$articleStats = $service->getStats($this->period);
$systemStats = $service->getSystemStats();
$availablePeriods = $service->getAvailablePeriods();
return view('livewire.dashboard', [
'articleStats' => $articleStats,
'systemStats' => $systemStats,
'availablePeriods' => $availablePeriods,
])->layout('layouts.app');
}
}