irfa / app-license-server
v1.2
2020-12-18 03:08 UTC
Requires
- php: ^7.2
- ext-json: *
- irfa/php-sn-generator: ^1.0
- laravel/framework: ^6.0|^7.0
README
此插件功能是创建一个序列号,该序列号将通过插件 客户端许可证 来访问
🛠️ 使用 Composer 安装
composer require irfa/app-license-server
您可以从这里获取 Composer here
🛠️ Laravel 设置
添加到 config/app.php
'providers' => [
....
Irfa\AppLicenseServer\AppLicenseServerServiceProvider::class,
];
添加到 config/app.php
'aliases' => [
....
'ALS' => Irfa\AppLicenseServer\Facades\AppLicenseServer::class,
],
发布供应商
php artisan vendor:publish --tag=app-license-server
运行迁移
php artisan migrate
配置文件
config/irfa/app_license_server.php
配置文件内
<?php return [ 'license_route' => '/check/license', 'route_name' => 'check_license', 'char_type' => 'alphanumeric', //Type alphanumeric,numeric,or alphabet 'length' => 4,//default : 4 'segment' => 4,//default : 4 'striped' => true,//default : true ];
注册新的序列号许可证
<?php namespace App\Http\Controllers; use ALS; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class LicenseController extends Controller { public function register(Request $request) { return ALS::register(['name'=>"Lorem", 'domain'=>"example.com", 'phone_number'=>"08123123", 'address'=>"Bandung,Indonesia"],now()->addDays(30)); } }
检查许可证
<?php namespace App\Http\Controllers; use ALS; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class LicenseController extends Controller { public function check(Request $request) { return ALS::serial($request->serial)->check(); } }
禁用序列号
ALS::serial($request->serial)->disabled();
启用序列号
ALS::serial($request->serial)->disabled();
##如何贡献?
- 将其分叉 (https://github.com/irfaardy/app-license-server/fork)
- 提交您的更改 (
git commit -m '新特性'
) - 推送到分支 (`git push origin your-branch`)
- 创建新的拉取请求
your-branch -> master
如果您发现错误或问题,请在此处发布 https://github.com/irfaardy/app-license-server/issues 以便它们可以一起维护。
Bagaimana cara berkontribusi?
- 在 (https://github.com/irfaardy/app-license-server/fork) 进行分叉
- 提交您的更改 (
git commit -m 'Fitur Baru'
) - 将更改推送到 master 分支 (`git push origin branch-kamu`)
- 创建新的 Pull Request
branch-kamu -> master
问题
如果您发现问题或错误,请在此处创建新问题 https://github.com/irfaardy/app-license-server/issues/new
如果您发现错误或问题,请在此处发布 https://github.com/irfaardyapp-license-server/issues 以便可以一起修复。