request()->url(), 'query' => request()->query(), ]); } public function totalPrice(EloquentCollection $collections) { return $collections->transform(fn($transactions) => $transactions->totalPrice()); } public function totalPriceGroup(EloquentCollection $collections) { return $this->totalPrice($collections)->sum(); } public function totalPriceGroupAsString(EloquentCollection $collections) { return (new CurrencyFormatService)->setRupiahFormat($this->totalPriceGroup($collections), true); } public function totalPerMonth(EloquentCollection $collections) { return $collections->transform(fn($collection) => $collection->count()); } public function statisticData(SupportCollection $collections, int $take = -1) { $collections = $collections->take($take); $collections->transform(fn($collections) => $this->totalPerMonth($collections)); return $collections; } }