{"id":14975337,"url":"https://github.com/irfaardy/php-sn-generator","last_synced_at":"2025-10-27T13:30:31.685Z","repository":{"id":49056994,"uuid":"322334373","full_name":"irfaardy/php-sn-generator","owner":"irfaardy","description":"Customable Serial Number Generator for PHP Native, Laravel and other PHP Framework","archived":false,"fork":false,"pushed_at":"2023-03-30T08:26:21.000Z","size":39,"stargazers_count":18,"open_issues_count":0,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T05:41:17.943Z","etag":null,"topics":["laravel","laravel-framework","laravel-package","license","lightweight","php-native","php-serial-number","plugins","randomizer","security","serial-number","serial-number-generator","serial-numbers","sn-generator","unique-id"],"latest_commit_sha":null,"homepage":"https://phpsngenerator.herokuapp.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irfaardy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"irfa","ko_fi":"irfaardy","custom":["https://buymeacoff.ee/irfaardy"]}},"created_at":"2020-12-17T15:23:13.000Z","updated_at":"2024-05-30T23:55:09.000Z","dependencies_parsed_at":"2024-06-21T16:44:57.574Z","dependency_job_id":"7d35965f-ca7f-483b-bbce-9b6b8069a6fc","html_url":"https://github.com/irfaardy/php-sn-generator","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":0.4864864864864865,"last_synced_commit":"e85ceb556b142b8b40d98a4631cf4c66352935d2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fphp-sn-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fphp-sn-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fphp-sn-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irfaardy%2Fphp-sn-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irfaardy","download_url":"https://codeload.github.com/irfaardy/php-sn-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238497670,"owners_count":19482296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-framework","laravel-package","license","lightweight","php-native","php-serial-number","plugins","randomizer","security","serial-number","serial-number-generator","serial-numbers","sn-generator","unique-id"],"created_at":"2024-09-24T13:51:53.413Z","updated_at":"2025-10-27T13:30:31.410Z","avatar_url":"https://github.com/irfaardy.png","language":"PHP","readme":"\r\n# 🚀PHP Serial Number Generator\r\n[![Maintainability](https://api.codeclimate.com/v1/badges/3f4b5d10a870b2301715/maintainability)](https://codeclimate.com/github/irfaardy/php-sn-generator/maintainability) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/irfaardy/php-sn-generator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/irfaardy/php-sn-generator/?branch=master) ![PHP Composer](https://github.com/irfaardy/php-sn-generator/workflows/PHP%20Composer/badge.svg?branch=master) [![Latest Stable Version](https://poser.pugx.org/irfa/php-sn-generator/v)](//packagist.org/packages/irfa/php-sn-generator)  [![GitHub license](https://img.shields.io/github/license/irfaardy/encrypt-file-laravel?style=flat-square)](https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE)  \u003cbr\u003e \r\n[![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/irfaardy) [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S52P7SN)\r\n[![Packagist Downloads](https://img.shields.io/packagist/dm/irfa/php-sn-generator.svg?label=Downloads)](https://packagist.org/packages/irfa/php-sn-generator)\r\n\r\nDemo https://phpsngenerator.herokuapp.com/ or demo source code https://github.com/irfaardy/php-sn-generator-demo\r\n\u003cp\u003eCustomable Serial Number Generator for PHP.\u003cp\u003e \r\n\u003cp\u003eWhere can this be used?\r\n\u003col\u003e\r\n\t\u003cli\u003eSerial number on the application\u003c/li\u003e\r\n\t\u003cli\u003eSecurity Token\u003c/li\u003e\r\n\t\u003cli\u003eVouchers Serial\u003c/li\u003e\r\n\t\u003cli\u003eActivation Apps Serial\u003c/li\u003e\r\n\t\u003cli\u003eReset Password link token\u003c/li\u003e\r\n\t\u003cli\u003eAPI Key\u003c/li\u003e\r\n\t\u003cli\u003eetc.\u003c/li\u003e\r\n\u003c/ol\u003e\r\n\u003cp\u003e\r\n\u003ch3\u003e🛠️ Installation with Composer \u003c/h3\u003e\r\n\r\n\r\n\r\n    composer require irfa/php-sn-generator\r\n\r\n\u003eYou can get Composer [ here]( https://getcomposer.org/download/)\r\n\r\n***\r\n\r\n\r\n\u003ch2\u003e🛠️ Laravel Setup \u003c/h2\u003e\r\n\r\n\u003ch3\u003eAdd to config/app.php\u003c/h3\u003e\r\n\r\n```php\r\n'providers' =\u003e [\r\n            ....\r\n            Irfa\\SerialNumber\\SerialNumberGeneratorSeviceProvider::class,\r\n     ];\r\n```\r\n\r\n\r\n\r\n\u003ch3\u003eAdd to config/app.php\u003c/h3\u003e\r\n\r\n```php\r\n'aliases' =\u003e [\r\n         ....\r\n  \t\t'SN' =\u003e Irfa\\SerialNumber\\Facades\\SerialNumber::class,\r\n\r\n    ],\r\n```\r\n\r\n  \u003ch2\u003ePublish Vendor\u003c/h2\u003e\r\n\r\n\r\n```bash\r\nphp artisan vendor:publish --tag=php-serial-number\r\n```\r\n\r\n\u003ch2\u003eConfig File\u003c/h2\u003e\r\n\r\n\u003ch4\u003eConfig Laravel\u003c/h4\u003e\r\n\r\n```bash\r\nconfig/irfa/serial_number.php\r\n```\r\n\r\n\u003ch4\u003eConfig non-Laravel or PHP Native\u003c/h4\u003e\r\n\r\n```bash\r\nvendor/irfa/php-sn-generator/config/config.php\r\n```\r\n\r\n```php\r\n\u003c?php \r\n\treturn [ \r\n\t/*\r\n    |--------------------------------------------------------------------------\r\n    | Serial Config\r\n    |--------------------------------------------------------------------------\r\n    |\r\n    | length    : length for one segment\r\n    | segment   : segment amount for Serial number \r\n    | seperator : striped segment for serial (set null if you do not wish to use seperator)\r\n    |\r\n    */\r\n\t\t'length'\t=\u003e 4,\r\n\r\n\t\t'segment'\t=\u003e 4,\r\n\t\r\n\t    \t'seperator'     =\u003e \"-\",\r\n\t\r\n\t    \t'charset'       =\u003e \"0123456789ABCDEFGHIJKLMNPQRSTUWXYZ\",\r\n\r\n];\r\n```\r\n\r\n\r\n\r\n\r\n\u003ch2\u003eExample Generate Serial Number (Laravel)\u003c/h2\u003e\r\n\r\n\r\n```php\r\n\u003c?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Http\\Controllers\\Controller;\r\nuse SN;\r\n\r\nclass SomethingController extends Controller\r\n{\r\n   \r\n    public function generate_serial(Request $request)\r\n    {\r\n        return SN::generate(); //result : TP8K-XU63-9YN3-SMSF\r\n    }\r\n}\r\n```\r\n\r\n\u003ch2\u003eExample Generate Serial Number PHP Native\u003c/h2\u003e\r\n\r\n\r\n```php\r\n\u003c?php\r\nrequire \"vendor/autoload.php\";\r\nuse Irfa\\SerialNumber\\Func\\SerialNumber;\r\n\r\n$sn = new SerialNumber();\r\n\r\necho $sn-\u003egenerate(); //result : TP8K-XU63-9YN3-SMSF\r\n   \r\n```\r\n\r\n\u003ch2\u003eOther Function\u003c/h2\u003e\r\n\u003ch4\u003eProgrammatically Config\u003c/h4\u003e\r\n\r\n```php\r\n//Laravel\r\nSN::setConfig([\t\r\n\t\t'length' =\u003e 5,\r\n\t\t'segment' =\u003e 4,\r\n\t\t'seperator' =\u003e '-',\r\n\t\t'charset' =\u003e \"123456789ABCDEFGH\"])\r\n\t-\u003egenerate();\r\n\t\r\n//PHP Native\r\n$sn = new SerialNumber();\r\n\r\necho $sn-\u003esetConfig([\t\r\n                        'length' =\u003e 5,\r\n                        'segment' =\u003e 4,\r\n                        'seperator' =\u003e '-',\r\n                        'charset' =\u003e \"123456789ABCDEFGH\"\r\n                    ])\r\n\t\t-\u003egenerate();\r\n```\r\n\r\n----\r\n\r\n## How to Contributing?\r\n\r\n1. Fork it (\u003chttps://github.com/irfaardy/php-sn-generator/fork\u003e)\r\n2. Commit your changes (`git commit -m 'New Feature'`)\r\n3. Push to the branch (`git push origin your-branch)\r\n4. Create a new Pull Request ` your-branch -\u003e master`\r\n\r\nif you found bug or error, please post here https://github.com/irfaardy/php-sn-generator/issues so that they can be maintained together.\r\n\r\n\r\n\r\n***\r\n## Bagaimana cara berkontribusi?\r\n\r\n1. Lakukan fork di (\u003chttps://github.com/irfaardy/php-sn-generator/fork\u003e)\r\n2. Commit perubahan yang anda lakukan (`git commit -m 'Fitur Baru'`)\r\n3. Push ke branch master (`git push origin branch-kamu)\r\n4. Buat Pull Request baru `branch-kamu -\u003e master`\r\n\r\n---\r\n## Issue\r\nIf you found issues or bug please create new issues here https://github.com/irfaardy/php-sn-generator/issues/new\r\n\r\nJika anda menemukan bug atau error silahkan posting disini https://github.com/irfaardy/php-sn-generator/issues agar dapat diperbaiki bersama-sama.\r\n\r\n***\r\n","funding_links":["https://patreon.com/irfa","https://ko-fi.com/irfaardy","https://buymeacoff.ee/irfaardy","https://www.buymeacoffee.com/irfaardy","https://ko-fi.com/S6S52P7SN"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firfaardy%2Fphp-sn-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firfaardy%2Fphp-sn-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firfaardy%2Fphp-sn-generator/lists"}