34 lines
906 B
PHP
34 lines
906 B
PHP
<?php
|
|
|
|
if (! function_exists('get_slack_channel_by_env')) {
|
|
|
|
function get_slack_channel_by_env($slack_channel = 'slack')
|
|
{
|
|
if (app()->environment() == 'local') {
|
|
return config("platform.notifications.{$slack_channel}.development_channel");
|
|
} else {
|
|
return config("platform.notifications.{$slack_channel}.production_channel");
|
|
}
|
|
}
|
|
}
|
|
|
|
if (! function_exists('get_exponential_posts_gen_by_day')) {
|
|
|
|
// Function to calculate the value for a given day
|
|
function get_exponential_posts_gen_by_day($day, $period_days = 45)
|
|
{
|
|
|
|
$min_value = 4;
|
|
$max_value = 150;
|
|
|
|
$growthRate = log($max_value / $min_value) / $period_days; // Calculate the growth rate
|
|
$value = round($min_value * exp($growthRate * $day));
|
|
|
|
if ($value > $max_value) {
|
|
return $max_value;
|
|
}
|
|
|
|
return $value;
|
|
}
|
|
}
|