<?php

namespace App\Reporting;

use Carbon\Carbon;
use Illuminate\Contracts\Support\Arrayable;
use Mtc\MercuryDataModels\Enquiry;

class EnquiryKPI implements Arrayable
{
    public function toArray()
    {
        return [
            'name' => 'Enquiries',
            'value' => Enquiry::query()
                ->where('created_at', '>=', Carbon::now()->startOfDay())
                ->count(),
            'subtitle' => 'Today',
        ];
    }
}
