id = $this->generateUid(); } /** * Generates a cryptographically safe unique ID. * * @since 1.0.0 * * @return string */ public function generateUid(): string { $bytes = openssl_random_pseudo_bytes(env('APP_UID_BYTES', 8)); return bin2hex($bytes); } }