定制 xetaio/xetaravel-iptraceable 二次开发

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

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

xetaio/xetaravel-iptraceable

最新稳定版本:12.0.0

Composer 安装命令:

composer require xetaio/xetaravel-iptraceable

包简介

A simple package that update an IP field when the user login into the application.

README 文档

README

Xetaravel IpTraceable

Stable Version Downloads Laravel License
Latest Stable Version Total Downloads Laravel 5.6 License

A simple package that update an IP field when the user login into the application. Also work with the remember_me token.

Requirement

PHP

Installation

composer require xetaio/xetaravel-iptraceable

ServiceProviders

Import the IpTraceableServiceProvider in your config/app.php:

'providers' => [
  //...
  Xetaio\IpTraceable\Providers\IpTraceableServiceProvider::class,
  //...
]

Middleware

Import the IpTraceable middleware in your app/Http/Kernel.php in the web part:

protected $middlewareGroups = [
   'web' => [
       //...
       \Illuminate\Session\Middleware\StartSession::class,
       \Xetaio\IpTraceable\Http\Middleware\IpTraceable::class,
       //...
   ],
   //...
];

Note : It's very important to import the middleware after the Illuminate\Session\Middleware\StartSession middleware, since this package use the session.

Config file

Publish the package config file to your application :

php artisan vendor:publish --provider="Xetaio\IpTraceable\Providers\IpTraceableServiceProvider" --tag=config

Database

Create 2 fields last_login_ip and last_login_date (optional) in your database :

// Must be nullable
$table->ipAddress('last_login_ip')->nullable();
$table->dateTime('last_login_date')->nullable(); // (optional) Disabled by default

The fields name can be changed in the configuration file.

Contribute

If you want to contribute to the project by adding new features or just fix a bug, feel free to do a PR.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-24