https://github.com/irfaardy/php-sn-generator
Customable Serial Number Generator for PHP Native, Laravel and other PHP Framework
https://github.com/irfaardy/php-sn-generator
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
Last synced: 3 months ago
JSON representation
Customable Serial Number Generator for PHP Native, Laravel and other PHP Framework
- Host: GitHub
- URL: https://github.com/irfaardy/php-sn-generator
- Owner: irfaardy
- License: mit
- Created: 2020-12-17T15:23:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T08:26:21.000Z (almost 3 years ago)
- Last Synced: 2025-02-01T05:41:17.943Z (12 months ago)
- 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
- Language: PHP
- Homepage: https://phpsngenerator.herokuapp.com/
- Size: 38.1 KB
- Stars: 18
- Watchers: 1
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🚀PHP Serial Number Generator
[](https://codeclimate.com/github/irfaardy/php-sn-generator/maintainability) [](https://scrutinizer-ci.com/g/irfaardy/php-sn-generator/?branch=master)  [](//packagist.org/packages/irfa/php-sn-generator) [](https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE)
[](https://www.buymeacoffee.com/irfaardy) [](https://ko-fi.com/S6S52P7SN)
[](https://packagist.org/packages/irfa/php-sn-generator)
Demo https://phpsngenerator.herokuapp.com/ or demo source code https://github.com/irfaardy/php-sn-generator-demo
Customable Serial Number Generator for PHP.
Where can this be used?
- Serial number on the application
- Security Token
- Vouchers Serial
- Activation Apps Serial
- Reset Password link token
- API Key
- etc.
🛠️ Installation with Composer
composer require irfa/php-sn-generator
>You can get Composer [ here]( https://getcomposer.org/download/)
***
🛠️ Laravel Setup
Add to config/app.php
```php
'providers' => [
....
Irfa\SerialNumber\SerialNumberGeneratorSeviceProvider::class,
];
```
Add to config/app.php
```php
'aliases' => [
....
'SN' => Irfa\SerialNumber\Facades\SerialNumber::class,
],
```
Publish Vendor
```bash
php artisan vendor:publish --tag=php-serial-number
```
Config File
Config Laravel
```bash
config/irfa/serial_number.php
```
Config non-Laravel or PHP Native
```bash
vendor/irfa/php-sn-generator/config/config.php
```
```php
4,
'segment' => 4,
'seperator' => "-",
'charset' => "0123456789ABCDEFGHIJKLMNPQRSTUWXYZ",
];
```
Example Generate Serial Number (Laravel)
```php
Example Generate Serial Number PHP Native
```php
generate(); //result : TP8K-XU63-9YN3-SMSF
```
Other Function
Programmatically Config
```php
//Laravel
SN::setConfig([
'length' => 5,
'segment' => 4,
'seperator' => '-',
'charset' => "123456789ABCDEFGH"])
->generate();
//PHP Native
$sn = new SerialNumber();
echo $sn->setConfig([
'length' => 5,
'segment' => 4,
'seperator' => '-',
'charset' => "123456789ABCDEFGH"
])
->generate();
```
----
## How to Contributing?
1. Fork it ()
2. Commit your changes (`git commit -m 'New Feature'`)
3. Push to the branch (`git push origin your-branch)
4. Create a new Pull Request ` your-branch -> master`
if you found bug or error, please post here https://github.com/irfaardy/php-sn-generator/issues so that they can be maintained together.
***
## Bagaimana cara berkontribusi?
1. Lakukan fork di ()
2. Commit perubahan yang anda lakukan (`git commit -m 'Fitur Baru'`)
3. Push ke branch master (`git push origin branch-kamu)
4. Buat Pull Request baru `branch-kamu -> master`
---
## Issue
If you found issues or bug please create new issues here https://github.com/irfaardy/php-sn-generator/issues/new
Jika anda menemukan bug atau error silahkan posting disini https://github.com/irfaardy/php-sn-generator/issues agar dapat diperbaiki bersama-sama.
***