<?php

declare(strict_types=1);

namespace App\Nova\Metrics;

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

final class TotalSessions extends Value
{
    public function calculate(NovaRequest $request): mixed
    {
        return $this->count($request, Session::class);
    }

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

    public function ranges(): array
    {
        return [
            30 => '30 Days',
            60 => '60 Days',
            365 => '365 Days',
            'TODAY' => 'Today',
            'ALL' => 'All Time',
        ];
    }

    public $cacheFor = null;
}
