<?php

declare(strict_types=1);

namespace App\Nova\Metrics;

use App\Models\Session;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Metrics\Trend;

final class SessionsTrend extends Trend
{
    public function calculate(NovaRequest $request): mixed
    {
        return $this->countByDays($request, Session::class);
    }

    public function name(): string
    {
        return 'Sessions';
    }

    public function ranges(): array
    {
        return [
            30 => '30 Days',
            60 => '60 Days',
            90 => '90 Days',
        ];
    }

    public $cacheFor = null;
}
