jord-jd/laravel-last-activity 问题修复 & 功能扩展

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

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

jord-jd/laravel-last-activity

最新稳定版本:v2.0.0

Composer 安装命令:

composer require jord-jd/laravel-last-activity

包简介

Stores the last activity time of users within your Laravel application

README 文档

README

Stores the last activity time of users within your Laravel application

Installation

To install the Laravel Last Activity package, just run the following Composer command from the root of your project.

composer require jord-jd/laravel-last-activity

Setup

This package requires you to register middleware within your app\Http\Kernel.php file. You will need add the middleware to every middleware group you wish to monitor activity for, as shown below.

protected $middlewareGroups = [
        'web' => [
            /* ... other web middleware ... */
            \JordJD\LaravelLastActivity\Http\Middleware\LastActivity::class
        ],

        'api' => [
            /* ... other api middleware ... */
            \JordJD\LaravelLastActivity\Http\Middleware\LastActivity::class
        ],
    ];

You also need to add the config file and migration to your project. To do so, simply run the following Artisan command.

php artisan vendor:publish --provider="JordJD\LaravelLastActivity\ServiceProvider"

You can then run the provided migration to add a last_activity field to your users table.

php artisan migrate

That's it. The last_activity field within your users will be automatically updated whenever the user interacts with your application via the web or API.

Alternative field name

If you do not wish to use last_activity as the field name, this can be changed in the provided migration. You will also need to alter the configuration file

The published configuration file for this package can be found at config/last-activity.php.

<?php

return [
    
    // Field in which the last activity date time will be stored.
    'field' => 'last_activity',
    
];

统计信息

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

GitHub 信息

  • Stars: 15
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2026-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固