Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mkwsra/2a21d98e9323a90dfbb8839483ba2218 to your computer and use it in GitHub Desktop.
Save mkwsra/2a21d98e9323a90dfbb8839483ba2218 to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
// ...
// ADD THIS STATIC FUNCTION.
static public function uuid()
{
return hash('crc32', time().hash('crc32', time().uniqid()));
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment