mahfuz/login-activity 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mahfuz/login-activity

Composer 安装命令:

composer require mahfuz/login-activity

包简介

This package will save login and logout activity of user

README 文档

README

This package will save successful login, failed login attempt and logout activity of user
Features:
  • Logging Successful Login Event with IP and User Agent Information.
  • Logging Logout Event with IP and User Agent Information.
  • Logging Failed Login Events with IP and User Agent Information.
  • Sending Email to User Upon Multiple Failed Login Attempts to Their Account On a Certain Time Interval to let them know about suspicious activity in their account.

Installation instructions for Laravel 5.3.*

Considering user_id as your primary column of users table follow below steps to install this package -

1. Installation

Install the package by running below command in your terminal -

composer require mahfuz/login-activity:dev-master

2. Adding Servicer Provider to Providers Array

Add below Service Provider in your providers array of config/app.php file

Mahfuz\LoginActivity\LoginActivityServiceProvider::class,

3. Running Migrations

Run php artisan migrate in your terminal. This will run a migration file required to make this project work which will create a table name login_activities in your database.

4. Adding Event Listeners

Add below event listeners to $listen array of app/Providers/EventServiceProvider.php

'Illuminate\Auth\Events\Login' => [
    'Mahfuz\LoginActivity\Listeners\LogSuccessfulLogin',
],

'Illuminate\Auth\Events\Failed' => [
    'Mahfuz\LoginActivity\Listeners\LogFailedLogin',
],

'Illuminate\Auth\Events\Logout' => [
    'Mahfuz\LoginActivity\Listeners\LogSuccessfulLogout',
],
5. Accessing Routes and Views

To view login activities visit this URL http://localhost:8000/login-activity.

*** Please note that url('login-activity') is protected by auth middleware. So, only logged in user can able to browse this route path.

6. Publishing Views, Migrations and Config files

Go to your project root via terminal and run php artisan vendor:publish

Once done check config/login-activity.php, you can configure it to whether send email upon 'X' failed login attempts in last 'N' minutes or not.

Also check resources/views/vendor/login-activity if you want to update login activity view and failed login attempt email view.

That's all.

Sample View:

Alt text

Happy Coding!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固