Last active
June 29, 2020 21:20
-
-
Save mkwsra/2a21d98e9323a90dfbb8839483ba2218 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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