updating env example file
This commit is contained in:
@ -17,7 +17,16 @@ if (! function_exists('snake2Title')) {
|
||||
}
|
||||
|
||||
if (! function_exists('carbon')) {
|
||||
function carbon(?string $timestring = null)
|
||||
/**
|
||||
* Return a Carbon object based on a given timestring.
|
||||
* It will attempt to find a timezone in the current
|
||||
* session but default to UTC.
|
||||
*
|
||||
* @param string|null $timestring
|
||||
*
|
||||
* @return \Carbon\Carbon
|
||||
*/
|
||||
function carbon(?string $timestring = null): \Carbon\Carbon
|
||||
{
|
||||
$carbon = Carbon\Carbon::now(session('timezone_name'));
|
||||
if (! empty($timestring)) {
|
||||
@ -28,7 +37,15 @@ if (! function_exists('carbon')) {
|
||||
}
|
||||
|
||||
if (! function_exists('jddayofweek')) {
|
||||
function jddayofweek(?int $intDay = null, int $mode = 0)
|
||||
/**
|
||||
* Returns the day of the week. Can return a string or an integer depending on the mode.
|
||||
*
|
||||
* @param int|null $intDay
|
||||
* @param int $mode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function jddayofweek(?int $intDay = null, int $mode = 0): string
|
||||
{
|
||||
if (is_null($intDay)) {
|
||||
$intDay = date('l');
|
||||
@ -41,3 +58,108 @@ if (! function_exists('jddayofweek')) {
|
||||
return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][$intDay];
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('cel2Fah')) {
|
||||
/**
|
||||
* Convert from celsius to fahrenheit.
|
||||
*
|
||||
* @param float|int|string $celsius
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function cel2Fah($celsius, int $preceision = 0): float
|
||||
{
|
||||
return round((($celsius * (9/5)) + 32), $preceision);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('fah2Cel')) {
|
||||
/**
|
||||
* Convert from fahrenheit to celsius.
|
||||
*
|
||||
* @param float|int|string $fahrenheit
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function fah2Cel($fahrenheit, int $preceision = 1): float
|
||||
{
|
||||
return round(($fahrenheit - 32 * (5/9)), $preceision);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('meters2Miles')) {
|
||||
/**
|
||||
* Convert from meters to miles.
|
||||
*
|
||||
* @param float|int|string $meters
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function meters2Miles($meters, int $preceision = 1): float
|
||||
{
|
||||
return round(($meters * 0.00062137), $preceision);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('kilometers2Miles')) {
|
||||
/**
|
||||
* Convert from kilometers to meters.
|
||||
*
|
||||
* @param float|int|string $kilometers
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function kilometers2Miles($kilometers, int $preceision = 1): float
|
||||
{
|
||||
return round(($kilometers * 1.609), $preceision);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('m2Km')) {
|
||||
/**
|
||||
* Convert from meters to kilometers.
|
||||
*
|
||||
* @param float|int|string $meters
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function m2Km($meters, int $preceision = 1): float
|
||||
{
|
||||
return round(($meters / 1000), $preceision);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('mm2Inches')) {
|
||||
/**
|
||||
* Convert from milimeters to inches.
|
||||
*
|
||||
* @param float|int|string $milimeters
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function mm2Inches($milimeters, int $preceision = 1): float
|
||||
{
|
||||
return round(($milimeters / 25.4), $preceision);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('pa2Mbar')) {
|
||||
/**
|
||||
* Convert from pascals to milibars.
|
||||
*
|
||||
* @param float|int|string $pascals
|
||||
* @param int $precision
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function pa2Mbar($pascals, int $preceision = 1): float
|
||||
{
|
||||
return round(($pascals / 100), $preceision);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user