Cleanup Utils #467 (#547)

* Remove Utils Facade
This commit is contained in:
Nabeel S
2020-02-11 12:32:41 -05:00
committed by GitHub
parent be6c164f03
commit b36a3009dd
27 changed files with 281 additions and 289 deletions

View File

@@ -11,6 +11,37 @@ use Nwidart\Modules\Facades\Module;
*/
class Utils
{
/**
* Returns a 40 character API key that a user can use
*
* @return string
*/
public static function generateApiKey(): string
{
$key = substr(sha1(time().mt_rand()), 0, 20);
return $key;
}
/**
* Simple check on the first character if it's an object or not
*
* @param $obj
*
* @return bool
*/
public static function isObject($obj): bool
{
if (!$obj) {
return false;
}
if ($obj[0] === '{' || $obj[0] === '[') {
return true;
}
return false;
}
/**
* Enable the debug toolbar
*/