Add (ai gen)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user