From 8a27ef30d540166a37437c447f0b463fe0555763 Mon Sep 17 00:00:00 2001 From: Mike Roquemore Date: Wed, 15 Jun 2022 21:52:15 -0500 Subject: [PATCH] Missing total argument on transformDeprecations method Removed duplicate array key on transformDeprecation method --- app/Http/Transformers/DepreciationsTransformer.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Http/Transformers/DepreciationsTransformer.php b/app/Http/Transformers/DepreciationsTransformer.php index abfbf151c6..fe63aca696 100644 --- a/app/Http/Transformers/DepreciationsTransformer.php +++ b/app/Http/Transformers/DepreciationsTransformer.php @@ -9,14 +9,14 @@ use Illuminate\Database\Eloquent\Collection; class DepreciationsTransformer { - public function transformDepreciations(Collection $depreciations) + public function transformDepreciations(Collection $depreciations, $total) { $array = []; foreach ($depreciations as $depreciation) { $array[] = self::transformDepreciation($depreciation); } - return (new DatatablesTransformer)->transformDatatables($array); + return (new DatatablesTransformer)->transformDatatables($array, $total); } public function transformDepreciation(Depreciation $depreciation) @@ -27,8 +27,7 @@ class DepreciationsTransformer 'months' => $depreciation->months.' '.trans('general.months'), 'depreciation_min' => $depreciation->depreciation_min, 'created_at' => Helper::getFormattedDateObject($depreciation->created_at, 'datetime'), - 'updated_at' => Helper::getFormattedDateObject($depreciation->updated_at, 'datetime'), - 'depreciation_min' =>($depreciation->depreciation_min), + 'updated_at' => Helper::getFormattedDateObject($depreciation->updated_at, 'datetime') ]; $permissions_array['available_actions'] = [ @@ -40,4 +39,4 @@ class DepreciationsTransformer return $array; } -} +} \ No newline at end of file