transformDatatables($array, $total); } public function transformDepreciation(Depreciation $depreciation) { $array = [ 'id' => (int) $depreciation->id, 'name' => e($depreciation->name), 'months' => $depreciation->months.' '.trans('general.months'), 'depreciation_min' => $depreciation->depreciation_type === 'percent' ? $depreciation->depreciation_min.'%' : $depreciation->depreciation_min, 'created_at' => Helper::getFormattedDateObject($depreciation->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($depreciation->updated_at, 'datetime') ]; $permissions_array['available_actions'] = [ 'update' => Gate::allows('update', Depreciation::class), 'delete' => Gate::allows('delete', Depreciation::class), ]; $array += $permissions_array; return $array; } }