From f1f7effcdaaddc50b283391572c0eea42be2a715 Mon Sep 17 00:00:00 2001 From: Saleem Hadad Date: Sat, 18 Mar 2023 20:26:27 +0400 Subject: [PATCH] add alltime range --- app/Domain/Metrics/Metric.php | 2 ++ app/Domain/Ranges/AllTime.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 app/Domain/Ranges/AllTime.php diff --git a/app/Domain/Metrics/Metric.php b/app/Domain/Metrics/Metric.php index dfe8ab3..b78daf1 100644 --- a/app/Domain/Metrics/Metric.php +++ b/app/Domain/Metrics/Metric.php @@ -4,6 +4,7 @@ use App\Domain\Element; use Illuminate\Support\Str; +use App\Domain\Ranges\AllTime; use \App\Domain\Ranges\LastYear; use \App\Domain\Ranges\LastMonth; use \App\Domain\Ranges\CurrentYear; @@ -41,6 +42,7 @@ public function ranges() new LastMonth, new CurrentYear, new LastYear, + new AllTime, ]; } diff --git a/app/Domain/Ranges/AllTime.php b/app/Domain/Ranges/AllTime.php new file mode 100644 index 0000000..62bc46c --- /dev/null +++ b/app/Domain/Ranges/AllTime.php @@ -0,0 +1,16 @@ +format("Y-m-d"); + } + + public function end() + { + return now()->format("Y-m-d"); + } +} \ No newline at end of file