irfa/php-sn-generator
Composer 安装命令:
composer require irfa/php-sn-generator
包简介
"Serial number generator for web aplication"
关键字:
README 文档
README
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
🛠️ Laravel Setup
Add to config/app.php
'providers' => [ .... Irfa\SerialNumber\SerialNumberGeneratorSeviceProvider::class, ];
Add to config/app.php
'aliases' => [ .... 'SN' => Irfa\SerialNumber\Facades\SerialNumber::class, ],
Publish Vendor
php artisan vendor:publish --tag=php-serial-number
Config File
Config Laravel
config/irfa/serial_number.php
Config non-Laravel or PHP Native
vendor/irfa/php-sn-generator/config/config.php
<?php return [ /* |-------------------------------------------------------------------------- | Serial Config |-------------------------------------------------------------------------- | | length : length for one segment | segment : segment amount for Serial number | seperator : striped segment for serial (set null if you do not wish to use seperator) | */ 'length' => 4, 'segment' => 4, 'seperator' => "-", 'charset' => "0123456789ABCDEFGHIJKLMNPQRSTUWXYZ", ];
Example Generate Serial Number (Laravel)
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use SN; class SomethingController extends Controller { public function generate_serial(Request $request) { return SN::generate(); //result : TP8K-XU63-9YN3-SMSF } }
Example Generate Serial Number PHP Native
<?php require "vendor/autoload.php"; use Irfa\SerialNumber\Func\SerialNumber; $sn = new SerialNumber(); echo $sn->generate(); //result : TP8K-XU63-9YN3-SMSF
Other Function
Programmatically Config
//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?
- Fork it (https://github.com/irfaardy/php-sn-generator/fork)
- Commit your changes (
git commit -m 'New Feature') - Push to the branch (`git push origin your-branch)
- 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?
- Lakukan fork di (https://github.com/irfaardy/php-sn-generator/fork)
- Commit perubahan yang anda lakukan (
git commit -m 'Fitur Baru') - Push ke branch master (`git push origin branch-kamu)
- 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.
irfa/php-sn-generator 适用场景与选型建议
irfa/php-sn-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.58k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2020 年 12 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「security」 「laravel」 「secure」 「decrypt」 「upload file」 「serial number」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 irfa/php-sn-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 irfa/php-sn-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 irfa/php-sn-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Secure Trading driver for the Omnipay PHP payment processing library
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
Provide a way to secure accesses to all routes of an symfony application.
It's a barebone security class written on PHP
Contao CMS integrity check for some files
Add a secure password generator to Signup Modal
统计信息
- 总下载量: 5.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 13
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-17