$uuid, 'user_id' => $user->id, 'activity_type' => $activityType->value, 'ip_address' => Request::ip(), 'form_id' => $formId, 'created_by' => $user->name, 'updated_by' => $user->name, ]); DB::commit(); } catch (\Exception $e) { DB::rollBack(); } } } if (!function_exists('activityYearRange')) { function activityYearRange(int $inventoryYear, $isDesc = true, int $range = 15): array { if ($isDesc == true) { return range($inventoryYear - 1, $inventoryYear - $range); } else { return range($inventoryYear - $range, $inventoryYear - 1); } } }