Add (ai gen)

This commit is contained in:
2023-10-01 00:35:27 +08:00
parent 645d0f1d02
commit f02081e30c
79 changed files with 4816 additions and 1041 deletions

View File

@@ -2,6 +2,13 @@
use Illuminate\Support\Str;
if (! function_exists('epoch_now_timestamp')) {
function epoch_now_timestamp()
{
return (int) round(microtime(true) * 1000);
}
}
if (! function_exists('str_first_sentence')) {
function str_first_sentence($str)
{
@@ -19,6 +26,20 @@ function str_first_sentence($str)
}
if (! function_exists('unslug')) {
function unslug($slug, $delimiter = '-')
{
return ucwords(str_replace($delimiter, ' ', $slug));
}
}
if (! function_exists('str_slug')) {
function str_slug($string, $delimiter = '-')
{
return Str::of(trim($string))->slug($delimiter);
}
}
if (! function_exists('is_empty')) {
/**
* A better function to check if a value is empty or null. Strings, arrays, and Objects are supported.