add metrics

This commit is contained in:
ludo
2024-01-30 23:24:00 +01:00
parent 1bc9bf9fe9
commit 8eb3104b2a
12 changed files with 226 additions and 70 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Repositories\Shop;
use App\Models\Shop\Customer;
use App\Repositories\Core\DateStats;
use App\Traits\Model\Basic;
class CustomerMetrics
{
use Basic, DateStats;
public static function countOfToday()
{
return Customer::ofToday()->count();
}
public static function countOfLastWeek()
{
return Customer::ofLastWeek()->count();
}
public static function countOfLastMonth()
{
return Customer::ofLastMonth()->count();
}
public static function getModel()
{
return Customer::query();
}
}