robertseghedi/laravel-advanced-security
Composer 安装命令:
composer require robertseghedi/laravel-advanced-security
包简介
This is a fresh Laravel plugin which gets security data from your users and gives you the chance to store it crypted or decrypted, with no stress. Educational purposes only / other purposes but on your own liability.
README 文档
README
One of the most optimized plugins for securing the Laravel users accounts.
This is a fresh Laravel plugin which gets security data from your users and gives you the chance to store it crypted or decrypted, with no stress. Educational purposes only / other purposes but on your own liability.
Instalation
First, you have to install the package using composer in your project root folder:
composer require robertseghedi/laravel-advanced-security
Then, you have to add the provider to your config/app.php like that:
// your providers RobertSeghedi\LAS\LASProvider::class,
Run the migrate command in order to add the secure-logs table
php artisan migrate
Information
| Command name | What it does |
|---|---|
| LAS::ip() | Gets the authenticated user's IP address |
| LAS::purify($data) | Purifies some string |
| LAS::os() | Gets the authenticated user's operating system |
| LAS::browser() | Gets the authenticated user's browser |
| LAS::file_size($kb) | Transforms numbered KB to 100 GB |
| LAS::password($length) | Generates random numbered-lettered password in the mentioned length - default is 10 |
| LAS::pin($length) | Generates a custom PIN in the mentioned length - default is 4 |
| LAS::ssl() | Returns if the actual site is secured or not (SSL) |
| LAS::log($user, $text) | Inserts an encrypted log with text to a user |
| LAS::logs($user, $results, $time) | Efficiently fetches & caches user logs based on the mentioned criteria |
| LAS::all_logs($results, $time) | Efficiently fetches & caches all the secure logs |
Usage
Now you can start using the package.
1. Include it in your controller
use RobertSeghedi\LAS\Models\LAS;
2. Start using the tools
public function add_post(Request $req) { $post = new Post(); $post->title = $req->input('title'); $post->description = $req->input('description'); $post->user = Auth::user()->id; $post->ip = LAS::ip(); // grabs the user IP $post->browser = LAS::browser(); // grabs the user browser $post->os = LAS::os(); // grabs the user OS $saved_post = $post->save(); if($saved_post) return redirect()->back()->with('success', 'Article posted.'); }
public function insert_log($user_id = null) { $user = User::find($user_id); $log = LAS::log($user_id, "$user->name joined the chat."); if($log) return redirect()->back(); }
3. Do whatever you want with the data
Follow this package for future updates
robertseghedi/laravel-advanced-security 适用场景与选型建议
robertseghedi/laravel-advanced-security 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 125 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 04 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 robertseghedi/laravel-advanced-security 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 robertseghedi/laravel-advanced-security 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 125
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-28