This package generate approved codes. Example: 1224, 456678, etc.
composer require tkachikov/code-generator
$code = CodeGenerator::get(4); // 0123
$code = CodeGenerator::get(6); // 123456
$hasCode = '0123';
$requestCode = 123;
$equal = CodeGenerator::equals($hasCode, $requestCode); // true
This package is open-sourced software licensed under the MIT license.