apichef/laravel-obfuscate
Composer 安装命令:
composer require apichef/laravel-obfuscate
包简介
Laravel package for obfuscating ids in urls.
关键字:
README 文档
README
Easy id obfuscation for Laravel
Install
Via Composer
$ composer require apichef/laravel-obfuscate
| Laravel | Minimum Versions |
|---|---|
| 5.x | ^1.0.0 |
| 6.x | ^1.0.0 |
| 7.x | ^2.0.0 |
| 8.x | ^2.0.0 |
| 9.x | ^3.0.0 |
| 10.x | ^4.0.0 |
| 11.x | ^4.0.0 |
Usage
Route Model Binding
// Model namespace App; use Illuminate\Database\Eloquent\Model; use ApiChef\Obfuscate\Obfuscatable; class Post extends Model { use Obfuscatable; // ... } // Route Route::get('/posts/{post}', function (Post $post) { return [ 'id' => $post->getRouteKey(), 'title' => $post->title, ]; })->name('post.show'); // Generate the URL to a named route. $post = Post::find(1); echo(route('post.show', $post)); // https://my-app.test/api/posts/458047115
Validation
namespace App\Http\Requests; use ApiChef\Obfuscate\Rules\HashExists; use Illuminate\Foundation\Http\FormRequest; class PostStoreRequest extends FormRequest { // ... public function rules() { return [ 'post_id' => [ 'required', new HashExists('posts', 'id') ], ]; } }
Facade
use ApiChef\Obfuscate\Support\Facades\Obfuscate; $result = Obfuscate::encode(1); // 458047115 $result = Obfuscate::encode([1, 2]); // [458047115, 2033899500] $result = Obfuscate::decode('458047115'); // 1 $result = Obfuscate::decode([458047115, 2033899500]); // [1, 2]
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email milroy@outlook.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
apichef/laravel-obfuscate 适用场景与选型建议
apichef/laravel-obfuscate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.99k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2020 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「obfuscation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 apichef/laravel-obfuscate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 apichef/laravel-obfuscate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 apichef/laravel-obfuscate 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple captcha generator
AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.
Replaces the default email address spam protection with a better one. The email obfuscation is more randomized, safer and more user friendly for the website visitor.
Convert integers between arbitrary bases with custom alphabets, salt, padding, and big-integer support.
Stand-alone antispambot function from WordPress
Microweber security scanner is a php antimalware/antivirus scanner script written in php for scan your project.
统计信息
- 总下载量: 15.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-12