Update
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
if (! function_exists('array_to_object_2025')) {
|
||||
/**
|
||||
* A magic function that turns all nested array into nested objects. Calling it with no parameter would result in a empty object.
|
||||
@@ -69,3 +71,23 @@ function array_is_assoc($array): bool
|
||||
return array_keys($array) !== range(0, count($array) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('hashids_encode')) {
|
||||
function hashids_encode($id)
|
||||
{
|
||||
return Hashids::encode($id);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('hashids_decode')) {
|
||||
function hashids_decode($string)
|
||||
{
|
||||
$arr = Hashids::decode($string);
|
||||
|
||||
if (count($arr) > 0) {
|
||||
return $arr[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user