定制 elkady/activity-logger 二次开发

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

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

elkady/activity-logger

最新稳定版本:v1.2.0

Composer 安装命令:

composer require elkady/activity-logger

包简介

A Laravel package for logging auths activities.

README 文档

README

A Laravel package for automatically logging authenticated users' actions (create, update, delete) on configured models.

Features

  • 🔄 Automatic Logging via Laravel Observers — no manual calls required
  • ⚙️ Configurable — choose which models to track
  • 🔗 Polymorphic Relations — works with multiple auth models
  • 🛠 Easy Integration — install, configure, done
  • 🚫 No Modification Needed for target models

Installation

Install the package via Composer:

composer require elkady/activity-logger

After installation you have to publish the config file

php artisan vendor:publish --provider="Elkady\ActivityLogger\ActivityLoggerServiceProvider" --tag=config

This will create a config file at:

config/activity-logger.php

then you have to migrate the added database:

php artisan migrate

Usage :

In any auth model you want to follow steps you have to use the HasActivityLogs like

use Elkady\ActivityLogger\Traits\HasActivityLogs;
class User extends Authenticatable
{
    use HasActivityLogs;
}

Update the Config File

In config/activity-logger.php, list the models you want to track: for example

return [
    'targets' => [
        App\Models\Post::class,
        App\Models\Order::class,
    ],

    'log_actions' => ['created', 'updated', 'deleted'],
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-04