定制 robertseghedi/laravel-advanced-security 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

统计信息

  • 总下载量: 125
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固